- 🇳🇿New Zealand quietone
Has this been resolved in the past 10 years?
This may be closed after three months if there are no comments to clarify what else needs to be done.
Follow-up to #2501989: [meta] Page Cache Performance →
The autoloader takes up to 500 us overall to just load and register namespaces, which is 10% of page cache response time. (5 ms)
Needless work, because lots of what makes it "slow" is work that can be done at:
a) Composer autoloader creation time
b) At container compilation / dump time
- The ClassLoader.php is already created dynamically.
Add a composer script hook for after autoloader creation to:
- Provide a ClassLoaderDrupal.php with a ClassLoaderDrupalInterface
which has all the classmap, PSR-4 namespaces, etc. already registered as variables => 1 load call, opcode cached, no run-time overhead.
- Add internal APC support that is enabled once the prefix key has been set.
- Create a faster interface to add PSR-4 namespaces with pre-compiled prefix lengths in one go => 1 call to register all namespaces of all modules
If the class loader is not of that interface => use the old way => no BC break
---
Is that providing our own solution? yes
Could it live upstream? For sure, wonder why they don't do it like that from the start ...
Lets also open an issue to solicit feedback ...
- Do it, benchmark it
- None
- Use a hybrid of composer class loader / APC classloader and some newly defined functions.
Postponed: needs info
11.0 🔥
It affects performance. It is often combined with the Needs profiling tag.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Has this been resolved in the past 10 years?
This may be closed after three months if there are no comments to clarify what else needs to be done.