Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Linux
Desktop
3 months ago
Test name Executions per second
.parents(:selector).first(); 516456.7 Ops/sec
.closest(:selector); 690583.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • .parents(:selector).first();

  • .closest(:selector);