swift-aws-lambda-runtime
swift-aws-lambda-runtime copied to clipboard
Performance documentation
@fabianfett please let me know if you'd like any X-Ray graphs to be generated.
If possible, I think it would be fair to mention performance of Foundation JSON encoder/decoder per https://github.com/swift-server/swift-aws-lambda-runtime/issues/153
swift-aws-lambda-runtime makes it easy to change it if one knows about it.
For reference results of a cold run of the same function with and without Foundation, note:
- shorter initialization (129 vs 168ms), the packages size is ~3MiB smaller without
libFoundation.sowhich (uncompressed) is 11.8 MiB size; although the heaviest one islibicudataswift.so.65with 28 MiB (!) - much faster
DecodeIn(11.9 vs 173ms) andEncodeOut(0.1 vs 40.ms) - lambda handlers use encoders provided by lambda which is probably why the one using
FoundationJSONEncoderis slower (can create subsegment for that to check it out); this example decodes and encodes very small payloads, the difference may be bigger if result is bigger - the difference is much less dramatic for warm runs
@fabianfett could you please update this PR to be against the main branch so we can delete the old master branch
closing in inactive PRs, feel free to re-open if still relevant