-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Control when PHP's garbage collector is triggered #5368
Merged
Merged
Conversation
This file contains 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
Codecov Report
@@ Coverage Diff @@
## main #5368 +/- ##
============================================
+ Coverage 86.67% 86.73% +0.06%
- Complexity 6170 6198 +28
============================================
Files 652 660 +8
Lines 19635 19727 +92
============================================
+ Hits 17019 17111 +92
Misses 2616 2616
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
bb41580
to
80d2afa
Compare
5ec000f
to
f132c80
Compare
3b7edd7
to
032c0f0
Compare
805212a
to
d7d70ea
Compare
d7d70ea
to
13b43a1
Compare
…rOfTestsBeforeGarbageCollection (int, default: 100) XML configuration settings
…:numberOfTestsBeforeGarbageCollection()
13b43a1
to
de96975
Compare
…GarbageCollectionEnabled events
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature/test-runner
CLI test runner
type/enhancement
A new idea that should be implemented
type/performance
Issues related to resource consumption (time and memory)
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.
When the PHP runtime automatically performs garbage collection then this may happen in the middle of the preparation (fixture setup) of a test or in the middle of the execution of a test. This can have a negative impact on test execution performance.
Solution proposed by @edorian in a conversation yesterday:
gc_disable()
before the first test is rungc_collect_cycles()
before the first test is rungc_collect_cycles()
after each n-th testgc_collect_cycles()
after the last test was rungc_enable()
after the last test was runGarbageCollectionHandler
that implements the above using PHPUnit's event systemGarbageCollectionHandler
when feature is enabled in XML configuration