Global handle allocation and reset are in the hot path of DOM element creation (see crbug.com/595492).
We can improve performance of these operations by making them inlineable from Blink and more cache friendly.
Currently the free global nodes are kept in a linked list with no guarantee of locality, so the node are likely to be scattered in memory.
In the following micro-benchmark freeing nodes in random order regresses performance of subsequent node allocations by 6x.
Freeing sequentially:
allocation1 35.832
clear1 13.571
alloaction2 14.672 <= allocation after free
clear2 13.074
sum -728379968
Freeing in random order:
allocation1 36.682
clear1 155.262
alloaction2 99.164 <= allocation after free
clear2 153.751
sum -728379968
Comment 1 by u...@chromium.org
, Jun 14 2016