Skip already loaded apps in loadApps#23940
Merged
MorrisJobke merged 1 commit intomasterfrom Nov 6, 2020
Merged
Conversation
rullzer
commented
Nov 6, 2020
| */ | ||
| public static function isAppLoaded(string $app): bool { | ||
| return in_array($app, self::$loadedApps, true); | ||
| return isset(self::$loadedApps[$app]); |
Member
Author
There was a problem hiding this comment.
just a lot faster that the in_array search
| ob_start(); | ||
| foreach ($apps as $app) { | ||
| if (($types === [] or self::isType($app, $types)) && !in_array($app, self::$loadedApps)) { | ||
| if (!isset(self::$loadedApps[$app]) && ($types === [] || self::isType($app, $types))) { |
Member
Author
There was a problem hiding this comment.
Changed the order here since the quick array check is just much much faster
Otherwise you might end up calling a lot of functions unneeded. And while the individual calls are cheap if you multiply them by 20k they still get somewhat expensive. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
daa2abf to
0dece78
Compare
juliusknorr
approved these changes
Nov 6, 2020
Member
|
/backport to stable20 |
|
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 35132: failuremysql5.6-php7.3Show full log |
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.
Otherwise you might end up calling a lot of functions unneeded.
And while the individual calls are cheap if you multiply them by 20k
they still get somewhat expensive.
I'll comment inline on the changes