dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.72k stars 166 forks source link

Support for Polka #116

Closed ghost closed 5 years ago

ghost commented 5 years ago

Polka is a lightweight and more performant competitor to express and currently isn't supported by your great serverless plugin. Are there plans to add (experimental) support for it in future? I believe this would make our functions take up even less time, computing power, and money.

dougmoscrop commented 5 years ago

Looks super easy to support. That said, framework overhead accounts for less than one millisecond in Lambda, so don't go rewriting your apps or anything, there wont be any measurable performance gain (it will easily be lost in the immense noise that the Lambda environment introduces, not just from cold starts but from huge variability in execution times due to bursty cpu/io)

ghost commented 5 years ago

@dougmoscrop Okay, great 👍 Switching between Polka, Express or literally any other framework is (at least most of the time) a matter of replacing the require statement, gladfully (When using it for ssr). I'm planning to eliminate cold-starts with Apex Ping, but I guess I won't be able to change the fact that Lambda wasn't designed for full-blown node servers 😄 I would greatly appreciate it if Polka finds it's way into serverless-http. Until then, I'll probably be using Koa or Fastify. Thanks for taking your time :)

dougmoscrop commented 5 years ago

Oh, no need to close. I can add support in a few minutes

dougmoscrop commented 5 years ago

2.2.0 should support Polka experimentally -- please reopen if there are any issues (or feel free to add more tests cases!)