Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Improve speed performance #60

Open

Description

@bluetidepro

As you probably know, the repo https://github.com/leafo/lessphp is no longer being supported so many people are starting to switch to this repo for their LESS php compiling.

I think the biggest complaint on the difference between your guys vs leafo's is the speed performance. (For example: leafo/lessphp#535 (comment))

Would it be possible to maybe take a closer look at how leafo's repo handles performance in a better way than your guys? It would be awesome if you could use any tactics they did to improve your guys script even more!

I love the script so far guys, and all the hard work you are putting into it. I'm also just trying to help you guys look for any more ways to improve it and get more people to switch from leafo's.

Thanks! 👍

Activity

  1. phpquery commented on Feb 3, 2014

    @phpquery

    +1 .. great lib with cool features.. cudos! performance is the only downside right now..
    Tell us how we might help to track down the performance issue..

    thx!

  2. oyejorge commented on Feb 3, 2014

    @oyejorge
    Owner

    Performance is definitely a bit of a drag. I've been use xdebug to figure out what parts of the program are the slowest. The following report is from compiling bootstrap 3.0.3 without any caching.
    xdebug-profile 1 6 1

  3. bluetidepro commented on Feb 3, 2014

    @bluetidepro
    Author

    Interesting. I think I will take a close look at some of the performance stuff too, to help you out @oyejorge. I'll do a pull request with any speed upgrades I can try to do.

    In general, I definitely think performance upgrades should be a high priority though. This is probably the only thing that less.php is lacking in right now.

    Thanks! :)

  4. phpquery commented on Feb 3, 2014

    @phpquery

    I ran a test with xhprof today.. compiling bootstrap 3.1.0
    See the following (partial) screenshot (the fullpage screenshot is 5MB )..:

    7a0b929c536cbcf164bac1022acf4e64

  5. oyejorge commented on Feb 3, 2014

    @oyejorge
    Owner

    Dang. So bootstrap is using &:extend functionality now. With
    Bootstrap < 3.1, we were able to skip the extend visitor completely.

  6. phpquery commented on Feb 3, 2014

    @phpquery

    Do want me to run it with a specific bootstrap version in comparison?

  7. phpquery commented on Feb 3, 2014

    @phpquery

    Ok, with bootstrap 3.0.0 it's about half the time:

    a6dc10f5c299cf8f76cfff74f3fcb1d1

  8. oyejorge commented on Feb 4, 2014

    @oyejorge
    Owner

    Thanks, I would expect it to be about half, the code for extend is pretty slow.

  9. oyejorge commented on Feb 8, 2014

    @oyejorge
    Owner

    @phpquery Would you mind testing out the latest code in the 1.6 branch? On my system, bootstrap 3.1 is taking about 5.5 seconds with the new code

  10. phpquery commented on Feb 8, 2014

    @phpquery

    Hm, no improvement here i'm afraid.. i checked out tag/1.6.1 vs. master several times.
    What were your local compile times with tag/1.6.1?

    i'm testing w/ bootstrap 3.1.0 parsing the central bootstrap.less file.. w/ this code:

    require_once 'less.php/lib/Less/Autoloader.php';
    Less_Autoloader::register();
    $parser = new Less_Parser();
    $parser->parseFile( realpath('bootstrap_3.1.0_less/bootstrap.less'), '/' );
    $css = $parser->getCss();

    my system/setup:
    OSX 10.6.8 @ MBP 2.2 i7 w/ SSD
    MAMP Pro 2.1.1: PHP 5.3.14, no Cache

  11. phpquery commented on Feb 8, 2014

    @phpquery

    followup: w/ PHP 5.4.4 i'm around 5.2 seconds.. ;)
    (however no differences between 1.6.1 and master..)

  12. oyejorge commented on Feb 8, 2014

    @oyejorge
    Owner

    Sorry, it's not tagged yet, it's just the current 1.6 branch. Here's the 1.6 branch download if it helps

  13. phpquery commented on Feb 8, 2014

    @phpquery

    Ok, branch 1.6 [c1a6b46] vs master/1.6.1 [f1a0ac9] is around:
    PHP 5.3.14: 6.2s vs. 7.5 ..
    PHP 5.4.4: 4.3s vs. 5.2s ..
    (just tell me what branch/commit for further tests.. i'm checking out w/ git anyway..)

  14. oyejorge commented on Feb 13, 2014

    @oyejorge
    Owner

    Some more performance improvements! Everything is up-to-date in the master branch.

  15. jdlx commented on Feb 13, 2014

    @jdlx

    better again.. cudos:

    PHP 1.6.1 f1a0ac9 master d9390c8
    5.3.14 ~ 7.5 ~ 5.6
    5.4.4 ~ 5.0 ~ 4.0
  16. bluetidepro commented on Feb 19, 2014

    @bluetidepro
    Author

    Getting much better, are you still looking into more ways to speed this up? :)

  17. oyejorge commented on Feb 20, 2014

    @oyejorge
    Owner

    I wouldn't say I've stopped working on performance. I think there's room for more improvements, but I've hit a wall so I'm going to take a little break and come back with a clear head.

    @phpquery, I still haven't gotten around to installing xhprof, could you post another screenshot like this one? Xdebug gives me similar information, but I like the comparison.

  18. jdlx commented on Feb 20, 2014

    @jdlx

    @oyejorge here you go.. this is a run with ba0f33c and PHP 5.4.4 :
    (setup as in #issuecomment-34522266)

    3d37d2aee3d7ba1e91eb5c4d479f262d

    (sry, no full screenshot right now.. awesome screenshot is passing out on a fullscreen one at the moment..)

  19. jdlx commented on Feb 20, 2014

    @jdlx

    ps.: if you want me to run tests via your included test suite let me know about the details how/where/what..

  20. oyejorge commented on Feb 20, 2014

    @oyejorge
    Owner

    That's perfect, thank you. I get the feeling those results are actually more accurate than what I'm getting with xdebug.

  21. jdlx commented on Feb 20, 2014

    @jdlx

    You're welcome.. i think it made sense if you jumped the hoop and installed xhprof(.io).. not that i'm not willing to run further test, no prob there, but the real thing could help you much more since you can drill down to the guts of each function/method.. or diffing 2 different runs and such.. etc.

  22. oyejorge commented on Mar 2, 2014

    @oyejorge
    Owner

    Just to throw this out there, I just added hhvm to the travis.yml to see (1) if the tests would pass and (2) what kind of performance improvements we'd see. Good news on both. All of the tests passed and completed in about half the time. 6.1 seconds on hhvm vs 11.8 seconds with php 5.5

  23. jdlx commented on Mar 4, 2014

    @jdlx

    what kind of performance improvements we'd see

    does hhvm have specific tools to evaluate performance?

  24. oyejorge commented on Mar 5, 2014

    @oyejorge
    Owner

    Not that I know of. I'm just looking at the time it takes travis-ci to complete the tests. Note: I'm not looking at the "Duration" time at the top of the page, but the "Time" at the bottom of the test results.

  25. danyj commented on Mar 17, 2014

    @danyj

    Just discovered , who ever is adding/compiling fontawesome with bootstrap it adds another 3sec to compile process.

  26. oyejorge commented on Jun 20, 2015

    @oyejorge
    Owner

    I know comparing run times of different php versions on travis-ci isn't the best way to judge performance but:

    php 5.6

    Time: 12.13 seconds, Memory: 40.75Mb

    php7

    Time: 2.82 seconds, Memory: 30.00Mb

  27. paladox commented on Oct 31, 2015

    @paladox
    Contributor
  28. paladox commented on Oct 31, 2015

    @paladox
    Contributor

    It shows MatchReg as being the one causing the performance errors https://camo.githubusercontent.com/27e0815b88a60d1770f6b8b39c8c61d48993fd73/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f363534303439342f323037303635302f35616162323963632d386431652d313165332d386430392d6535363033643032343438662e706e67

    and is causing performance errors for other code since they are requiring it making the performance error for it too. I would say break down code that requires MatchReg and duplicate it which may results In improve performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions