Comments (2)
This will result in a huge class map containing all classes, right? But in most cases only a remarkably smaller portion of all classes (especially in lib) are actually being used. The resulting classmap might be unnecessary big eating up memory and making accessing it slower.
What would be the benefit of a pre-generated classmap?
from aoe_classpathcache.
Benefits are evident:
- No file name lookup over the include path at all, just file include, with opcache it means no disk access at all
- With APC/ZendPtimizer generated php file is in opcache, so again no disk access
Regarding memory, we can try to hash class name with crc32 and use SplFixedArray (http://php.net/manual/en/class.splfixedarray.php) or judy arrays (http://www.php.net/manual/en/class.judy.php).
Memory footprint of judy array is very small, especially if we go with crc32 and of Judy::INT_TO_MIXED mode (crc32($fileName) => $path). I believe it would be around 5MB, but some benchmarks are needed of course.
Becuase there is no serialization support in judy arrays at the moment it can be used only with opcache.
In non-opcache mode we can try to utilize crc32 + SplFixedArray (if memory footprint isn't too big) or fallback to current implementation.
However I'm not sure there is any sense to consider non-opcache mode at all.
All modern websites use opcache. And since judy arrays need additional extension, why not install ZendOptimizer or APC too?
from aoe_classpathcache.
Related Issues (12)
- composer.json is not up to date, forked module not accessible via Composer HOT 1
- Automatically revalidate if class can't be found
- Code pool local HOT 5
- Cache deletion HOT 1
- Permission denied on classPathCache.php HOT 2
- Add unit testing and travis configuration
- cache clear problems
- Add interface in backend HOT 1
- Cannot clear cache behind load balancer HOT 11
- PHP realpath cache related?
- Varien_Autoload::searchFullPath() - consider using stream_resolve_include_path instead of foreach HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aoe_classpathcache.