:has() subtree benchmark

Compare 0, 1 or 2 :has() checks against a fresh tree with a hidden subtree.

Workload

Presets fill the form. Press Run to start.

Deep trees may crash the tab. Stop works between trials.

Ready.

Results

Times in milliseconds. Cells show median [minimum–maximum]. Warmups are excluded.
Batch:has countDepth / leavesElementsSamplesBuild DOMAttachForced evaluationRemoveEvaluation mode
Every trial
BatchPhaseRepeat:has countElementsBuild DOMAttachEvaluationRemoveColor check
Notes

Test document: