[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal
WordPress Trac
noreply at wordpress.org
Fri Sep 16 03:45:30 UTC 2016
#36335: Next generation: core autoloader proposal
-----------------------------+------------------
Reporter: dnaber-de | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 4.7
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------
Comment (by Cybr):
Replying to [comment:194 TJNowell]:
>
> - What performance improvements can autoloading provide?
> - What problem does this solve?
Performance improvements:
1. None when every file is required. It's actually about twice as slow,
but we're talking microseconds here.
2. A lot when only some files are required. When WordPress only requires
files and classes it needs, the memory overhead is much lower.
Requiring/including files is also the about the slowest thing within PHP.
Problem(s) it solves:
1. Developers can freely use any class within WordPress without being
afraid to crash the system for when the class has been called "too early".
2. Memory issues are pretty much gone. For example, on a sitemap, I do not
require to load the loop.
Problem(s) it creates:
1. The known action order is gone. This might not seem like a big deal,
but with some things I had to face the issue of a JIT action/filter
injection. These JIT injection things might break as some actions are
spread over multiple files and classes.
'''I'm very much against using Composer.'''
It creates another dependency to which Core needs to fix bugs against.
Updating it also creates issues. For example, why are we still stuck using
jQuery 1.x instead of using the much faster 2.x or even 3.x?
Answer: WordPress loves backwards compatibility (a little too much).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:195>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list