cb944a2d
by Francis De Brabandere at 2026-06-15T22:14:44+02:00
vbscript: Index named items by name.
Named item lookups walked the item list linearly, so hosts that
register many named items, such as one item per document element, paid
a cost proportional to the item count for every host object reference.
Keep the items in an rb tree keyed by name, with each tree entry
listing the items sharing that name in registration order.
With 500 named items, 300k references to the last item drop from 694 ms
to 116 ms, and the time no longer depends on item position or count,
matching the flat profile measured for native vbscript.