oyejorge / less.php

less.js ported to PHP.
http://lessphp.typesettercms.com
Apache License 2.0
657 stars 2 forks source link

Performance improvements (+4% to speed in Magento2) #378

Closed andrey-legayev closed 4 years ago

andrey-legayev commented 4 years ago

Hi,

I've run xdebug profiler for Magento2 static content deploy and found huge amount of calls to in_array() I've tried to optimize it and got ~4% performance improvement.

Pls review my changes.

Andrey

andrey-legayev commented 4 years ago

It looks like travis config is outdated... PHP versions are not supported anymore

andrey-legayev commented 4 years ago

Travis conf updated. All unit tests are passed.

hostep commented 4 years ago

@andrey-legayev: great job!

However, Magento2 is no longer going to use this original less.php library, they'll be moving to a different fork: https://github.com/wikimedia/less.php/ in Magento 2.3.3 and higher (see https://github.com/magento/magento2/commit/9a4332cb18945772c1458d53cd1a9c191c3f7a10). That last one is better maintained then this original fork and has support for PHP 7.3 which Magento 2.3.3 needs.

So you'd best also send the same PR to the wikimedia fork :)

andrey-legayev commented 4 years ago

Thanks, I'll check it out

andrey-legayev commented 4 years ago

Submitted to Wikimedia fork: https://github.com/wikimedia/less.php/pull/14