Various minor improvements to speed up by ~10%#8193
Merged
Conversation
02fe7f8 to
3fd96be
Compare
* check isset for all elements first, as array_diff is much more expensive * Improves performance by 1%
* sort is much more expensive than count, so we only sort if we have something to sort * could implement for ksort too, but advantage there is minimal since we almost always have more than 1 possibility * use same hash algorithm as in other places (= faster) * reduces runtime by 2-3%
improves performance by ~1-1.5%
* do not concatenate with timestamp as this is slow, since $file_contents may be big * use file contents not file path for cache hash only to ensure it works if file_path not set but file_content is * improves performance by ~5%
* reduces I/O by 30% * minimal performance improvement (<0.5%)
3fd96be to
9058608
Compare
orklah
reviewed
Jun 28, 2022
orklah
reviewed
Jun 28, 2022
f917bca to
9058608
Compare
Contributor
Author
|
Branch is ready to be merged. Sorry for many force push, but the tests don't work for me locally. Some step by step guidance/link on how to run the tests locally (or where the composer is installed, even when on a remote server) would be appreciated. |
Collaborator
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve various minor things to speed up psalm performance by about 10%
No negative impact on memory consumption.
Will invalidate old caches (= most cache files created with any previous psalm versions will not be used anymore and new caches will be created on first run, since the cache hash changed for performance reasons)