swift-aws-lambda-runtime icon indicating copy to clipboard operation
swift-aws-lambda-runtime copied to clipboard

Performance documentation

Open fabianfett opened this issue 5 years ago • 2 comments

fabianfett avatar May 19 '20 15:05 fabianfett

@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.so which (uncompressed) is 11.8 MiB size; although the heaviest one is libicudataswift.so.65 with 28 MiB (!)
  • much faster DecodeIn(11.9 vs 173ms) and EncodeOut(0.1 vs 40.ms)
  • lambda handlers use encoders provided by lambda which is probably why the one using Foundation JSONEncoder is 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
Screen Shot 2020-08-14 at 11 08 02 Screen Shot 2020-08-14 at 11 08 20

pokryfka avatar Aug 14 '20 07:08 pokryfka

@fabianfett could you please update this PR to be against the main branch so we can delete the old master branch

tomerd avatar Oct 05 '20 18:10 tomerd

closing in inactive PRs, feel free to re-open if still relevant

tomerd avatar Jan 22 '24 17:01 tomerd