Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Reduce memory consumption compiling container#18061
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
(cherry picked from commitc8cb253)
… to minimise for opcache in place of stripComments, which has been removed along with tests.
| $this->targetDirRegex =null; | ||
| return$code; | ||
| // Replace '/**' comment openings with '/*' for non-debug container to optimise for opcache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
optimise ->optimize (we mostly use American English in code and docs) Thanks!
nicolas-grekas commentedMar 8, 2016
I was about to comment that this doesn't work for the general case: the str_replace cas alter strings in parameters e.g. |
peteward commentedMar 8, 2016
Good point. I couldn't find any reference to stripComments but I guess it would be BC break as it's public... I'll have another go! |
peteward commentedMar 8, 2016
Hmm unfortunately about 50% of my container is Proxy classes which are generated through What about a more targeted preg_replace looking for opening and closing comments followed by keywords like |
sstok commentedMar 8, 2016
That will fail when a parameter contains actual One alternative solution would be to use a different tokenizer that doesn't load the tokens in memory but rather uses a stream or something. |
peteward commentedMar 8, 2016
indeed, quite a few examples of people struggling with |
Further to#18048 by@nicolas-grekas, keep the same memory savings at Container compilation time but through a str_replace of the whole container string instead of optional addition of extra opening comment
*as originally proposed.Remove
stripCommentsand associated test.