-
Notifications
You must be signed in to change notification settings - Fork 140
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
Don't use comments? #161
Comments
does |
Yes, it saves opcache shared memory. The memory load for each PHP file is reduced by the number of bytes of comments in the file, iiuc. I agree that it's not necessary to implement without reflecting on comments but I think it's desirable. We cannot in general quantify the benefit of setting
|
Fwiw, OPcache stats from my servers currently show
Not a huge difference but it's not insignificant. |
Nothing much changed. Detailed opcache status below shows server A and B have almost identical opcache use (no surprise, they have almost identical load). The only important difference is used_memory which is ~10% more with with comments. (This opcache has been up for just over a month.)
|
Thank you for the detailed stats! |
I'm interested in to see if there is any development in this issue. Ubuntu, Debian and Thank you. |
If you want to use this lib without comments, you could extend the markdown flavor class you want to use and override the following method: Lines 254 to 285 in eeb1bf6
if you hardcode the array of markers and function names it should all work with I might add some docs about it and possibly also add a configuration option for it... |
this can be solved in PHP 8 by using attributes: https://wiki.php.net/rfc/attributes_v2 |
@cebe, yes I'm sure it can. It can be solved also with conventional programming. But the issue with opcache is actually small enough. Allocate enough memory to opcache and stop worrying about it. In my case the problem has gotten smaller with time as I use fewer comments. With type hints and good names for functions and parameters, comments can be redundant. |
It's not ideal that this relatively small dependency dictates
opcache.save_comments=1
at the web server config level.I think you could refactor the
parseXyz()
methods and@marker
comments that are organized into classes and traits into\Closure
s and strings organized into assoc arrays.What do you think?
The text was updated successfully, but these errors were encountered: