mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
The existing implementation uses the RubyArray as the key for the fast lookup Map. Under the covers the Map implementation is comparing equal operators (many times per event), and JRuby Array equals operator is VERY expensive since it literally walks each value of array for each equality. Based on profiling via YourKit, the JRuby Array equals operator is a very hot method consuming upto 60% of sampled CPU cycles while under high load (and no other CPU dominators). This change is to use the .hash value of the JRuby Array as the key of the fast lookup Map. This implementation still calls .hash for each and every call, which is also expensive, since it also walks the arrays to compute the hash. However, the equality check of the hash value is very fast, and net gain is significant. Upto a 15% increase of throughput. Fixes #7772 Fixes #7798 |
||
---|---|---|
.. | ||
benchmarks | ||
lib | ||
locales | ||
spec | ||
src | ||
.lock | ||
build.gradle | ||
gemspec_jars.rb | ||
logstash-core.gemspec | ||
settings.gradle |