mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 18:36:38 +02:00
Shape::visit_edges used to walk every entry of m_property_table and call PropertyKey::visit_edges on each key. For non-dictionary shapes that work is redundant: m_property_table is a lazily built cache of the transition chain, and every key it contains was originally inserted as some ancestor shape's m_property_key, which is already kept alive via m_previous. Intrinsic shapes populated through add_property_without_transition() in Intrinsics.cpp are not dictionaries and have no m_previous to reach their keys through, but each of those keys is either a vm.names.* string or a well-known symbol and is strongly rooted by the VM for its whole lifetime, so skipping them here is safe too. Measured on the main WebWorker used by https://www.maptiler.com/maps/ this cuts out ~98% of the PropertyKey::visit_edges calls made by Shape::visit_edges each GC, reducing time spent in GC by ~1.3 seconds on my Linux PC while initially loading the map.
14 KiB
14 KiB