MatthewMueller/cheerio — pull request #371 by kpdecker (2014-01-27 19:05:02+00:00)
Title: Add benchmark coverage for all $ APIs

Exec from my machine locally. There are a few low hanging fruit here which I will have a followup PR for.

Test: Select all (file: jquery.html)
cheerio x 394 ops/sec ±5.06% (90 runs sampled)
jsdom x 95.79 ops/sec ±10.39% (57 runs sampled)
Fastest: cheerio

Test: Select some (file: jquery.html)
cheerio x 299 ops/sec ±10.75% (68 runs sampled)
jsdom x 94.96 ops/sec ±8.53% (62 runs sampled)
Fastest: cheerio

Test: manipulation - append (file: jquery.html)
cheerio x 1,280 ops/sec ±21.84% (26 runs sampled)
jsdom x 231 ops/sec ±14.45% (64 runs sampled)
Fastest: cheerio

Test: manipulation - prepend (file: jquery.html)
cheerio x 1,239 ops/sec ±25.81% (32 runs sampled)
jsdom x 217 ops/sec ±13.49% (66 runs sampled)
Fastest: cheerio

Test: manipulation - before (file: jquery.html)
cheerio x 1,182 ops/sec ±23.59% (19 runs sampled)
jsdom x 151 ops/sec ±46.50% (46 runs sampled)
Fastest: cheerio

Test: manipulation - after (file: jquery.html)
cheerio x 1,329 ops/sec ±20.62% (26 runs sampled)
jsdom x 180 ops/sec ±11.40% (54 runs sampled)
Fastest: cheerio

Test: manipulation - remove (file: jquery.html)
cheerio x 19,332 ops/sec ±11.54% (60 runs sampled)
jsdom x 1,416 ops/sec ±61.62% (48 runs sampled)
Fastest: cheerio

Test: manipulation - replaceWith (file: jquery.html)
cheerio x 271 ops/sec ±13.47% (62 runs sampled)
jsdom x 1,297 ops/sec ±11.26% (66 runs sampled)
Fastest: jsdom

Test: manipulation - text (file: jquery.html)
cheerio x 2,359 ops/sec ±8.65% (72 runs sampled)
jsdom x 32.67 ops/sec ±11.30% (45 runs sampled)
Fastest: cheerio

Test: manipulation - empty (file: jquery.html)
cheerio x 9,413 ops/sec ±10.60% (80 runs sampled)
jsdom x 93.79 ops/sec ±24.40% (40 runs sampled)
Fastest: cheerio

Test: manipulation - html (file: jquery.html)
cheerio x 3,387 ops/sec ±14.24% (71 runs sampled)
jsdom x 39.20 ops/sec ±11.98% (53 runs sampled)
Fastest: cheerio

Test: traversing - Find (file: jquery.html)
cheerio x 344 ops/sec ±6.61% (74 runs sampled)
jsdom x 21.79 ops/sec ±68.99% (42 runs sampled)
Fastest: cheerio

Test: traversing - Parents (file: jquery.html)
cheerio x 0.41 ops/sec ±7.91% (6 runs sampled)
jsdom x 117 ops/sec ±9.83% (64 runs sampled)
Fastest: jsdom

Test: traversing - Parent (file: jquery.html)
cheerio x 442 ops/sec ±10.25% (65 runs sampled)
jsdom x 6,265 ops/sec ±10.95% (66 runs sampled)
Fastest: jsdom

Test: traversing - Closest (file: jquery.html)
cheerio x 6.35 ops/sec ±14.50% (21 runs sampled)
jsdom x 155 ops/sec ±10.81% (77 runs sampled)
Fastest: jsdom

Test: traversing - next (file: jquery.html)
cheerio x 20,417 ops/sec ±10.52% (71 runs sampled)
jsdom x 198 ops/sec ±12.69% (60 runs sampled)
Fastest: cheerio

Test: traversing - nextUntil (file: jquery.html)
cheerio x 283 ops/sec ±10.67% (62 runs sampled)
jsdom x 148 ops/sec ±12.50% (61 runs sampled)
Fastest: cheerio

Test: traversing - nextAll (file: jquery.html)
cheerio x 384 ops/sec ±9.72% (68 runs sampled)
jsdom x 8.96 ops/sec ±12.06% (26 runs sampled)
Fastest: cheerio

Test: traversing - prev (file: jquery.html)
cheerio x 20,065 ops/sec ±8.16% (77 runs sampled)
jsdom x 380 ops/sec ±9.80% (64 runs sampled)
Fastest: cheerio

Test: traversing - prevAll (file: jquery.html)
cheerio x 392 ops/sec ±9.06% (73 runs sampled)
jsdom x 8.98 ops/sec ±15.15% (27 runs sampled)
Fastest: cheerio

Test: traversing - prevUntil (file: jquery.html)
cheerio x 246 ops/sec ±14.24% (59 runs sampled)
jsdom x 122 ops/sec ±17.30% (44 runs sampled)
Fastest: cheerio

Test: traversing - Children (file: jquery.html)
cheerio x 217 ops/sec ±12.39% (54 runs sampled)
jsdom x 315 ops/sec ±9.85% (66 runs sampled)
Fastest: jsdom

Test: traversing - siblings (file: jquery.html)
cheerio x 251 ops/sec ±11.78% (64 runs sampled)
jsdom x 3.36 ops/sec ±19.35% (12 runs sampled)
Fastest: cheerio

Test: traversing - First (file: jquery.html)
cheerio x 515,261 ops/sec ±14.59% (61 runs sampled)
jsdom x 408,651 ops/sec ±14.31% (49 runs sampled)
Fastest: cheerio

Test: traversing - Filter (file: jquery.html)
cheerio x 179 ops/sec ±42.74% (48 runs sampled)
jsdom x 6,412 ops/sec ±13.96% (55 runs sampled)
Fastest: jsdom

Test: traversing - Eq (file: jquery.html)
cheerio x 684,500 ops/sec ±12.97% (64 runs sampled)
jsdom x 673,934 ops/sec ±11.36% (64 runs sampled)
Fastest: cheerio,jsdom

Test: attributes - Attributes (file: jquery.html)
cheerio x 1,147 ops/sec ±11.96% (63 runs sampled)
jsdom x 60.81 ops/sec ±10.02% (55 runs sampled)
Fastest: cheerio

Test: attributes - Val (file: jquery.html)
cheerio x 309 ops/sec ±14.01% (59 runs sampled)
jsdom x 42.22 ops/sec ±15.32% (49 runs sampled)
Fastest: cheerio

Test: attributes - Data (file: jquery.html)
cheerio x 1,541 ops/sec ±16.77% (54 runs sampled)
jsdom x 2,749 ops/sec ±14.02% (50 runs sampled)
Fastest: jsdom

Test: attributes - Has class (file: jquery.html)
cheerio x 6,176 ops/sec ±11.44% (51 runs sampled)
jsdom x 1,551 ops/sec ±12.04% (49 runs sampled)
Fastest: cheerio

Test: attributes - Add Remove class (file: jquery.html)
cheerio x 280 ops/sec ±11.94% (65 runs sampled)
jsdom x 34.08 ops/sec ±13.59% (45 runs sampled)
Fastest: cheerio

Test: traversing - Last (file: jquery.html)
cheerio x 473,115 ops/sec ±15.86% (62 runs sampled)
jsdom x 804,581 ops/sec ±3.83% (93 runs sampled)
Fastest: jsdom

Test: attributes - Toggle class (file: jquery.html)
cheerio x 342 ops/sec ±4.63% (75 runs sampled)
jsdom x 82.68 ops/sec ±2.55% (74 runs sampled)
Fastest: cheerio