Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CSS-Packer CPAN distribution.

Report information
The Basics
Id: 59240
Status: resolved
Priority: 0/
Queue: CSS-Packer

People
Owner: Nobody in particular
Requestors: colink [...] perlDreamer.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.03_01



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
There is a development version of HTML::Packer available on http://github.com/nevesenin/html-packer-perl