4 ms·
> There's an example too, but this could use more emphasis. To be fair, handling lambda cold start is AWS lambda 101, and initialization is the starting point.
by arinlen 4y ago
> There's an example too, but this could use more emphasis.
To be fair, handling lambda cold start is AWS lambda 101, and initialization is the starting point. I'd say that the only people not aware of this is those who are just taking their first steps.
This requirement is even notorious in JDK lambdas, and leads to the need to use dependency injection frameworks to handle initialization and consequently favour compile-time dependency injection frameworks such as Dagger over runtime ones like Guice.
> things that could be safely cached in a hashmap, etc.
I'd add that caching data in /tmp to get it through lazy evaluation is also a quite basic technique. The contents of /tmp are preserved between some calls and checking if the data is still there is an effective technique to shave off some milliseconds.