-
Notifications
You must be signed in to change notification settings - Fork 11.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
[9.x] Improve Performance On Terminate #41406
Conversation
But |
I think this is possibly a breaking change? People could have been messing with what was in that array as part of a termination handler. 10.x is probably the safest place for this, especially since the performance improvement is only very minor. |
I don't think it would be a breaking change, the function to register the termination callback uses an integer index on the array, and based on the previous code uses an integer index to call. See : framework/src/Illuminate/Foundation/Application.php Lines 1149 to 1176 in cf29656
|
@SupianIDz This was changed on purpose to the way it is currently and the performance impact was well explained in the MR -> #39175 And yes, reverting that change would be a breaking change. |
Maybe a test would be great to verify that behavior |
No plans to change this. |
count
is used in a loop and is a low performance constructionbased on several experiments, I conclude that using
foreach
is better. Indeed, this performance increase does not really affect the framework, but why not?Ubuntu Server
MacBook Air