Subject: | Use of $& slows down packing |
As discussed here:
http://blog.timbunce.org/2010/07/09/nytprof-4-04-came-saw-ampersand-and-conquered/
and in many other places, using $& will cause performance issues in
every regexp throughout the entire application.
The attached patch removes the $& variable and uses $1 instead. All
tests from the existing test suite pass.
Subject: | css_ampersand.patch |
Only in CSS-Packer-0.2_patch: blib
diff -r CSS-Packer-0.2/lib/CSS/Packer.pm CSS-Packer-0.2_patch/lib/CSS/Packer.pm
80c80
< $value =~ s/"(\\.|[^"\\])*"/&$_do_content( $& )/egs;
---
> $value =~ s/("(?:\\.|[^"\\])*")/&$_do_content( $1 )/egs;
201c201
< ${$scalarref} =~ s/$COMMENT/&$_do_comment( $& )/egsm;
---
> ${$scalarref} =~ s/$COMMENT/&$_do_comment( $1 )/egsm;
Only in CSS-Packer-0.2_patch: Makefile
Only in CSS-Packer-0.2_patch: pm_to_blib
Only in CSS-Packer-0.2_patch/t/stylesheets: s1-got.css
Only in CSS-Packer-0.2_patch/t/stylesheets: s2-got.css
Only in CSS-Packer-0.2_patch/t/stylesheets: s3-got.css
Only in CSS-Packer-0.2_patch/t/stylesheets: s4-got.css