pjfanning commented on PR #539: URL: https://github.com/apache/pekko-http/pull/539#issuecomment-2072303941
I benchmarked this using https://github.com/pjfanning/pekko-test/blob/main/bench/src/main/scala/org/example/pekko/ByteStringBench.scala The new code (in this PR) was faster for byte strings that are made up of multiple byte strings but slower for simple byte strings. ``` [info] Benchmark Mode Cnt Score Error Units [info] ByteStringBench.newGetInputStream thrpt 3 752.065 ± 787.928 ops/s [info] ByteStringBench.newGetInputStreamSimple thrpt 3 447966.746 ± 273762.965 ops/s [info] ByteStringBench.oldGetInputStream thrpt 3 535.979 ± 1080.417 ops/s [info] ByteStringBench.oldGetInputStreamSimple thrpt 3 486935.775 ± 222571.828 ops/s ``` While the speedup for complex byte strings is good and the slowdown for simple byte strings is proportionally small - it might not be worth the hit. I presume that the MethodHandle adds an overhead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
