fidian / PrettyCSS

CSS beautifier, lint checker, validator
Other
34 stars 12 forks source link

Too slow when parsing large CSS files #7

Closed fidian closed 12 years ago

fidian commented 12 years ago

Try a 50k minified CSS file and the parser will choke. This comes down to tokenize.js's tokenize() function. It needs to continually make a shorter and shorter str by using str = str.substr(match.length). Perhaps make this faster by starting patterns at a given offset, working on buffers, or re-engineering the whole matching algorithm to work entirely in JavaScript using a character-by-character approach.

fidian commented 12 years ago

Found and fixed.