DescriptionIntroduce TreeScopeEventContext.
Some information can be shared between EventContexts whose TreeScope is the same.
Instead of storing such information in each EventContext (which is created per Node), store such information in newly introduced TreeScopeEventContext (which is created per TreeScope).
Though it might take some computation cost to share such information, the pros is much bigger than the cons.
We have to traverse only treeScopes, rather than nodes, when calculating some information, such as adjusted relatedTarget, adjusted event path, adjusted touch targets and so on.
We can get benefits both in time and space as follows:
1. Time
The result of the benchmarks are:
PerformanceTests/Events/EventDispatching.html
541 runs/s vs 594 runs/s (10% better score)
PerformanceTests/Events/EventDispatchingInShadowTrees.html
4625 runs/s vs 5741 runs/s (24% better score)
2. Space
We can reduce the memory footprint about 1.5 KBytes per an event.
BUG=329445
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164501
Patch Set 1 #
Total comments: 1
Patch Set 2 : Rename SharedEventContext to TreeScopeEventContext #
Messages
Total messages: 6 (0 generated)
|