mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
Constructing the HashMap in DeclarativeEnvironment was by far the most expensive thing when making JavaScript function calls. As it turns out, we don't really need this to be a HashMap in the first place, as lookups are cached (by EnvironmentCoordinate) after the first access, so after that we were not even looking in the HashMap, going directly to the bindings Vector instead. This reduces function_declaration_instantiation() from 16% to 9% when idling in "Biolab Disaster". It also reduces has_binding() from 3% to 1% on the same content. With these changes, we now actually get to idle a little bit between game frames on my machine. :^)
7.6 KiB
7.6 KiB