Small performance optimization in lz4 compressor implementation#1910
Small performance optimization in lz4 compressor implementation#1910joao-r-reis wants to merge 1 commit intoapache:trunkfrom
Conversation
Patch by João Reis; reviewed by TBD for CASSGO-90
f5ecf06 to
ece2ca7
Compare
worryg0d
left a comment
There was a problem hiding this comment.
Honestly, I didn't expect the copy function call on a zero-length source to cost that much... But well, it is still a call, so it makes sense. I assume the same applies to the zero value slicing thing...
Also, this is why I don't like to make such big patches with a lot of different areas involved. It takes a lot of time to identify such things.
Anyway, thanks @joao-r-reis! You've done a really great job with this one. If it were me, I would spend much more time trying to identify this. On the other hand, this is a good lesson for me
|
Yeah honestly I microbenchmarked the |
|
Ok after some profiling I decided to go with a different approach to mitigate the performance regression that we are seeing. I'm not convinced the changes on this PR even helped that much anyway so I'm closing this in favor of #1912 (and repurposed the JIRA ticket) |
Ran some benchmarks to compare 2.0.0-rc1 with 1.7.0 and noticed a 2-3% degradation when compression was enabled. I made these quick optimizations, re-ran the tests and the degradation went away (0-1%).
Benchmark code here (
firstbranch, will eventually merge it)Results here in the "compression fix test" tab.