mozilla / rhino

Rhino is an open-source implementation of JavaScript written entirely in Java
https://rhino.github.io
Other
4.18k stars 851 forks source link

Optimize performance of SlotMap a bit #1670

Closed rPraml closed 1 month ago

rPraml commented 1 month ago

This is a small improvement, but I imagine it is measurable

gbrail commented 1 month ago

I will check this myself later, but you can also verify the effects yourself, by running:

BENCHMARK=SlotMap ./gradlew jmh

(or the equivalent on Windows)

gbrail commented 1 month ago

FWIW this didn't result in any measurable changes (Java does a ton of optimization of bytecode including making uncontended synchronization very cheap). But if you all think it makes sense -- less bytecode is always good -- I'm happy to merge it.