You mean template-0 through template-9
]]>you’re right about the caching. My experience is that serialize() and unserialize() are pretty quick, but print_r() could also be used to generate a PHP include file thats initialize the data structure as well.
If you’re loading a small number of classes from a very large set, there will eventually be a crossover point where you’re better off keeping the mapping in a persistent key/value store than loading the whole thing.
It would be a fun bunch of experiments, but the performance is good enough for me right now.
]]>One thing I’d like to reiterate is caching your class-to-file map if you’re going to use an autoloader such as the one I proposed. I’ve found that in some of my largest applications, It can take as much as 4 seconds to scan all of the files and build the map. That’s obviously not desirable. However, once the map is built and cached, it runs very quickly.
Depending on your system, you might want to try caching with Memcached or sqlite vs serialization. I’d like to experiment with a sqlite adaptation and compare that with the cost of serialization.
]]>