3 ms·
What is your experience? Go is an AOT compiled language so the only thing I could imagine you running into on startup is loading the binary into memory? Theres
by philosopher1234 6y ago
What is your experience? Go is an AOT compiled language so the only thing I could imagine you running into on startup is loading the binary into memory? Theres not a cold-start issue with Go, as its not an optimizing JIT.
Edit: Bizarre. Seems like Go on lambda does actually have slower cold start than JS or Python. I wonder if its just that the binary is likely larger than the equivalent JS source code? https://levelup.gitconnected.com/aws-lambda-cold-start-language-comparisons-2019-edition-%EF%B8%8F-1946d32a0244 https://levelup.gitconnected.com/aws-lambda-cold-start-langu...
- nicoburns 6y agoI'm not sure about lambda, but cloudflare workers use v8 isolates to avoid starting a new process at all.
- tgv 6y agoMy experience is that Go cold start takes around 900ms. Processing (parsing a JSON message, verifying it with one DynamoDB look-up, and storing it in DynamoDB) then takes between 11ms and 105ms. Go does use less memory than node, though, and that also counts in Lambda. I hadn't expected it either, but it loads node faster. Perhaps via some VM trick?
- gen220 6y ago> The function did nothing except emit ‘hello world’. A more realistic benchmark would be parsing a 1kb protobuf blob and printing some random key from it. (this would require importing a non-stdlib parser) Without knowing how it's implemented, my guess is that they're conserving python/v8 processes, so that they're not cold-starting the interpreter on each lambda execution. You can't [1] do the same thing for a Go binary, so they have to invoke a binary, which might involve running some scans against it first. This leads to some pretty counterintuitive conclusions! If you want minimal latency (in Lambda!!), you really should be using JS/Python, I guess. [1]: OK. Maybe you could. Go has a runtime after all, although it's compiled into the binary! I have never heard of anybody doing this, but I'd love to read something about it. :)
- indymike 6y agoGo binaries are pretty large compared to say, C.
- Thaxll 6y agoGo is not AOT compiled.
- philosopher1234 6y ago... yes it is?