mozilla/servo — pull request #1152 by ILyoan (2013-10-30 08:03:25+00:00)
Title: Parallel selector matching

This an attempt to parallelize selector matching.

Approach
* Let the `match_subtree` spawn limited number of tasks.
* Each of them takes a list of nodes that is uniformly distributed
* And then each task does the selector matching for every single node in its list.

(Not sure if this is worthwhile for long term especially considering CSS optimizing techniques such as ancestor filter or style sharing)

Benchmark from my machine (LayoutSelectorMatchCategory) (intel i7 3.4GHz * 8, linux x86_64)
* src/test/demo.html
* original: 0.07ms
* parallel: 0.20ms
* A test page with 15000 nodes and 3000 CSS selector(including inline style).
* original: 140ms
* parallel: 60ms