-
Notifications
You must be signed in to change notification settings - Fork 548
More optimizations #4767
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
More optimizations #4767
Conversation
|
applying this diff: diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php
index 611c11f598..64503833a5 100644
--- a/src/Analyser/LazyInternalScopeFactory.php
+++ b/src/Analyser/LazyInternalScopeFactory.php
@@ -59,6 +59,14 @@ final class LazyInternalScopeFactory implements InternalScopeFactory
bool $nativeTypesPromoted = false,
): MutatingScope
{
+ static $i = 0;
+ if ($i === 0) {
+ register_shutdown_function(function () use (&$i) {
+ var_dump($i);
+ });
+ }
+ $i++;I wonder why we only save very few scope creations after the before this might also be the reason why it does not really improve performance |
|
additionally I see nearly no |
|
I see no meaningful performance improvements here, only bugs :) I'll keep it open, you can keep looking into it. I am also surprised it doesn't improve anything. Maybe the current code is already crazily well optimized. I suspect the line |
I have a similar feeling that blackfire cannot point out a specific bootleneck anymore because we got most of the code equal fast |
|
I'd expect the if (rand(0, 1)) {
$a = 1;
} elseif (rand(0, 1)) {
$a = 2;
} else {
$a = 3;
}If it's not the case then the optimization is not working as intended. |
|
its invoked 4 times |
|
Abandoning this idea :) |
No description provided.