Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize en Optimize (A LOT) PHP platform #290

Merged
merged 1 commit into from
Nov 26, 2020

Conversation

lyrixx
Copy link
Collaborator

@lyrixx lyrixx commented Nov 25, 2020

Hello, It's me again. I used this project in one of my application, and ... bad news. Our static analyzer (very famous, very used) crash because the file is way too big.

I wanted to do this PR a while ago, because the project is nice, but the PHP code was a bit "old" 😄


So here is what I did:

  • Use an external file to be able to run static analysis tool (ATM,
    analyzer crash because the file is too big)
  • Enable the opcache caching feature (better for the RAM)
  • Use key instead of value when searching in the array
  • Add type hint everywhere
  • Use generator to lazy load evualuation as much as possible
  • Bump requirements to PHP 7.3 (almost EOL BTW: https://www.php.net/supported-versions.php)

Results are ❤️ ! For the current test suite, on my computer:

Before: Time: 36.94 seconds, Memory: 68.51 MB
After: Time: 2.78 seconds, Memory: 66.51 MB

😎

* Use an external file to be able to run static analysis tool (ATM,
  analyzer crash because the file is too big)
* Enable the opcache caching feature (better for the RAM)
* Use key instead of value when searching in the array
* Add type hint everywhere
* Use generator to lazy load evualuation as much as possible
@FGRibreau
Copy link
Owner

Hey :)

Nice upgrade however this is going to be a breaking change so I will release a new major version 👍

@FGRibreau FGRibreau merged commit 94796c6 into FGRibreau:master Nov 26, 2020
@FGRibreau
Copy link
Owner

Released in v4.0.0 👍 thanks :)

@lyrixx lyrixx deleted the php-the-good-way branch November 26, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants