feat(type-safe-api): enable snapstart for java handlers by default and optimise java interceptors #597
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Java handlers now have snapstart enabled by default to improve cold start times.
Ensure logging, metrics and tracing interceptors perform as much initialisation as possible during the init phase which can therefore be saved from snapstart invocations.
Also move the annotation processing to the init phase since this takes approximately a second.
This reduces cold start times from ~25s down to ~4s. Warm invocations remain the same at <100ms.
On a cold start it seems as though the logger takes about 500ms per log, and the tracer takes about 1500ms to end the subsegment - so there may be an opportunity to reduce the 4s cold start even further if we can figure out why :)
Fixes #572