pre-phpx icon indicating copy to clipboard operation
pre-phpx copied to clipboard

Improving parser performance

Open sevfurneaux opened this issue 7 years ago • 5 comments
trafficstars

This project is great!

My only hesitation to not use this in production is the parser compile time.

Any points in the parser where it could be improved? Happy to help 😁

sevfurneaux avatar Nov 17 '18 12:11 sevfurneaux

I'm sure there is loads in the parser that could be made better. I am working on a pre/plugin refactor at the moment, so I'll come back to this when that's done. In the meantime, you can create a pre.lock file in the project root, which will disable the automatic rebuild of every PSR-4 class on every invocation.

Edit: @sevfurneaux: I have released a version of pre/plugin which doesn't throw errors while generating an optimised autoloader. You can use version ^0.11.4. Running composer du -o should pre-compile all the .pre files (included with PSR-4) and then disable the custom autoloader. You should then have opcache-enabled PHP files in production, making this virtually zero-cost to use there.

assertchris avatar Jan 19 '19 07:01 assertchris

@sevfurneaux if you think phpx is interesting, check out the experiment I have going: https://github.com/preprocess/example-phpx-live

assertchris avatar Jan 19 '19 07:01 assertchris

@assertchris Thanks – this is super interesting!

sevfurneaux avatar Jan 27 '19 11:01 sevfurneaux

Wrote a post about how it works, here: https://assertchris.io/post/2019-01-19-phpx-live

assertchris avatar Jan 27 '19 11:01 assertchris

Very cool! Will read up on this.

sevfurneaux avatar Jan 27 '19 20:01 sevfurneaux