richthegeek / phpsass

A compiler for SASS/SCSS written in PHP, brought up to date (approx 3.2) from a fork of PHamlP: http://code.google.com/p/phamlp/
http://phpsass.com/
382 stars 83 forks source link

More Performance issues Token-function #102

Closed lochmueller closed 7 years ago

lochmueller commented 11 years ago

Hey guys,

i found same more issues: http://pastebin.com/Zt9VwrQa

I have one SASS file that use a part of the compass. The scssToken-function take 15% of a non cached request to the server (after the first hit, phpsass is not started anymore, but the first hit is very slow). That is a huge amount of time, because there are other phpsass functions that need time and there is also a TYPO3 beneath ;)

The patch reduce the amount auf strlen-calls on constant variables (8.000) and reduce over 108.000 calls of is_null in the while-logic. Please check the patch and review it. I think about it and test a little bit and have no mutual reaction.

Thanks for the last quick response...

PS: SassList::_build_list is very inefficient too, but I have no good clue (just the unused variable $size, but that is no performance boost ;) )

== Before: before

== After: after

...

Regards, Tim

lochmueller commented 7 years ago

Cleanup my created tasks.... close this one.