anmonteiro / aws-lambda-ocaml-runtime

An OCaml custom runtime for AWS Lambda and Vercel
BSD 3-Clause "New" or "Revised" License
207 stars 8 forks source link

Poor performances ? #1

Closed vanwalj closed 5 years ago

vanwalj commented 5 years ago

Hey ! It seems we had the same idea https://github.com/vanwalj/aws-lambda-ocaml ! :D

I'm quite new to Ocaml, so i'm not sure what to expect but my handler seems pretty slow. I get between 30 and 100ms (most of the time around 50ms) response time once the lambda is warmed up. Did you notice something similar ?

anmonteiro commented 5 years ago

No, I'm getting generally 20 - 50ms for a simple Lambda.

vanwalj commented 5 years ago

Thanks ! I'll try to figure out why then :)

anmonteiro commented 5 years ago

What are the design decisions behind your project? Do you think we need 2 of these for OCaml?

vanwalj commented 5 years ago

Definitely not, I'm quite new to Ocaml, and that was mainly to get my fet wet with Dune and Opam. TBH I didn't expect someone else to write this lib for Ocaml so I opened an opam-repo PR. But i'll be really happy to drop it in favor of your's !

anmonteiro commented 5 years ago

@vanwalj I appreciate that. Are you in the OCaml discord? Let's collaborate. Here's an invite: https://discord.gg/KF8JrM

quincycs commented 4 years ago

I just recently stumbled upon your work because your talk was uploaded :) . Wanted to post here to say how excited I am about the performance of this stuff. e.g. https://twitter.com/_anmonteiro/status/1069737583855443974

you got it even faster?? 1-10 ms?? I feel like that is unheard of in the lambda space! Has anyone ever dug deeper into showing off how native Reason for lambda is a huge performance gain? What if you discovered the fastest language on lambda?

anmonteiro commented 4 years ago

@quincycs yeah a simple hello world lambda runs in less than a millisecond now. Example from a Zeit Now log:

Duration: 0.78 ms  Billed Duration: 100 ms  Memory Size: 3008 MB  Max Memory Used: 40 MB    

What if you discovered the fastest language on lambda?

I think this is on par with Lambdas written in Rust / Go / even Node.js if you use the official Node runtimes (which I assume are very optimized for latency by AWS), so I don't think we've stumbled into anything new here.

Has anyone ever dug deeper into showing off how native Reason for lambda is a huge performance gain?

That's what I tried to do in my ReasonConf US talk (and the ReasonConf Vienna open stage). If you wanna try it out further and write something about it feel free to reach out and I can help you troubleshoot stuff and help you through it.

quincycs commented 4 years ago

Would be fun to add Reason to an existing benchmark. E.g. https://github.com/theam/aws-lambda-benchmark

This hasn't been done yet right? If I get it done or need help, I'll reach out. Thanks.

anmonteiro commented 4 years ago

I don't think it has been done. I'd add "OCaml" or "OCaml / Reason" instead of just Reason, though.