How low have people been able to get their coldsta...
# random
t
How low have people been able to get their coldstarts to?
a
5 seconds.
😞
t
wow I thought mine was slow haha
a
I’m using TypeORM and Inversify.
Think that might slow things up.
r
We have functions that cold start and complete their work in about 1.4s Not sure how much of that is 'cold start'
a
😮
I might need to get rid of dependency injection 😂 .
Or try other library.
t
I'm at around 2s for the same cold start + finish work. I think maybe 2-300ms of that is the work + apig latency so probably around 1.7s
~150ms of that is from fetching config from SSM
a
@thdxr you use middy for caching ssm?
t
No I do something freaky
a
Ah ok.
t
I want loading ssm to block everything so that all of my modules can reference the values without any kind of dependency injection stuff. So I use deasync to block node until it's loaded
a
Not sure what is deasync.
For those using RDS… any improvements on cold-start using Proxy?
t
deasync is a hacky library that can block node's event loop until a callback fires. It is evil but I need it for what I want to do
So if I have a module that's
Copy code
import { Config } from "./config"

console.log(Config.VALUE)
This module will block when importing Config until SSM is loaded for the first time
a
I see, yes, Middy also has a middleware for eventloop blcoker.
t
Ah interesting. The reason I don't rely on middy for this is I seperate more core business logic from anything Lambda related. So this code can work even if just calling from a script outside of a lambda context
So it works in tests + random scripts I need