premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

Add `RuleSet::Declarations` to separate concerns #118

Closed ojab closed 3 years ago

ojab commented 3 years ago

Before:

Executing: bundle exec rake benchmark
Warming up --------------------------------------
 import1.css loading   374.000  i/100ms
 complex.css loading    14.000  i/100ms
Calculating -------------------------------------
 import1.css loading      3.776k (± 3.4%) i/s -     19.074k in   5.057674s
 complex.css loading    147.035  (± 8.2%) i/s -    742.000  in   5.086269s

Loading `import1.css` allocated 358 objects, 26 KiB
Loading `complex.css` allocated 9711 objects, 728 KiB

After:

Executing: bundle exec rake benchmark
Warming up --------------------------------------
 import1.css loading   404.000  i/100ms
 complex.css loading    14.000  i/100ms
Calculating -------------------------------------
 import1.css loading      3.712k (± 6.7%) i/s -     18.584k in   5.032369s
 complex.css loading    144.133  (± 7.6%) i/s -    728.000  in   5.082960s

Loading `import1.css` allocated 372 objects, 26 KiB
Loading `complex.css` allocated 10437 objects, 752 KiB
ojab commented 3 years ago

Changes applied, good to go.