Opened 6 years ago
Last modified 3 years ago
#41520 new enhancement
Disable deprecated functions
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bootstrap/Load | Keywords: | has-patch dev-feedback |
Focuses: | performance | Cc: |
Description
In bootstrap process, deprecated.php, pluggable-deprecated.php and ms-deprecated.php are includes. These files include all the deprecated functions in core. This is done for compatibility reasons, however there are many setups that do not requires these functions as they are not using any of these functions. These files inline over 4500 lines of code ( 3881 + 208 + 518 ). There should be an option to disable them.
Attachments (1)
Change History (11)
#3
@
6 years ago
As the numbers seemed to be too good to be true, I re-ran the tests, with much more sober results.
The above was tested against an extremely bad reference measurement. It is actually difficult to test due to the OpCode cache.
Running multiple tests back and forth, it seems to average out at about 1.2% wall time improvement on my machine.
#4
@
6 years ago
Btw, the tests were run on PHP 7.0.20. I'd expect the improvements to be better on older PHP versions.
#5
@
6 years ago
I think that even at 2-3% improvement is still work the time to investigate. The patch is very simple after all. It works in the current bootstrap process. Not sure how it works with autoloadinf etc.
This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.
6 years ago
#7
@
6 years ago
this might sound stupid, so apologies. But would it be possible to make stub functions than can be included if someone does enable, so that they can find in their dev-server logs the notices before pushing to staging or production?
It's literally cloning the function signatures, but having them raise a deprecated notice (since it's easy to grep or scan logs for that).
It would be different to existing deprecated message. Just saying the define from the attached patch has stopped loading functionname
.
I've run this simple change through the profiler.
I've done 3 50-samples runs on an empty site against the
wp-json/wp/v2/posts
endpoint. This gave me these numbers:Even if these numbers are not 100% accurate, it should be safe to assume that this change is an improvement.