MatthewMueller/cheerio — pull request #387 by kpdecker (2014-02-21 23:16:24+00:00)
Title: Optimize Attribute Encoding

Store attributes in decoded form so we do not need to encode/decode multiple times.

Test: attributes - Attributes (file: jquery.html)
cheerio x 7,999 ops/sec ±4.13% (72 runs sampled)
old x 4,423 ops/sec ±1.05% (98 runs sampled)
jsdom x 65.22 ops/sec ±5.70% (69 runs sampled)

Test: attributes - Single Attribute (file: jquery.html)
cheerio x 838,986 ops/sec ±5.47% (71 runs sampled)
old x 328,370 ops/sec ±3.00% (90 runs sampled)
jsdom x 11,593 ops/sec ±3.69% (88 runs sampled)

Test: attributes - Data (file: jquery.html)
cheerio x 188,847 ops/sec ±3.71% (79 runs sampled)
old x 6,894 ops/sec ±3.14% (89 runs sampled)
jsdom x 3,963 ops/sec ±2.68% (89 runs sampled)