logstash-plugins / logstash-filter-jdbc_static

Loads a DB query's result set in memory and uses it as lookup table for events.
Apache License 2.0
11 stars 12 forks source link

Avoid premature optimization #52

Open andsel opened 4 years ago

andsel commented 4 years ago

The case at lines https://github.com/logstash-plugins/logstash-filter-jdbc_static/blob/master/lib/logstash/filters/jdbc/read_write_database.rb#L7-L17

does a premature optimization, JRuby AOT compiler (but I think also the JIT) convert the looping in a bytecode for loop, then JVM JIT during optimization phases unroll the cycle or does better optimizations.