AOEpeople / Aoe_ClassPathCache

Class path cache for Magento autoloader
http://www.fabrizio-branca.de/magento-class-path-cache.html
Open Software License 3.0
49 stars 16 forks source link

Use a real PHP array for the cache #29

Open joshuaadickerson opened 7 years ago

joshuaadickerson commented 7 years ago

This creates an array instead of using a serialized object for the cache. This should be more efficient.

tmotyl commented 7 years ago

Hi When I did performance test back then (2013) comparing different scenarios (including php file, php serializing , json encode etc) the one used here was the fastest. So deserializing was faster than including PHP file (meaning php has to load the file, parse it and interpret).

It would be quite interesting to see the performance test on the current PHP 7, to see if this change gives any performance improvement at all.

joshuaadickerson commented 7 years ago

Benchmarks know best, but that is illogical to me. PHP has to unserialize the string before it can use it. Whereas with a PHP file, APC will cache it as a file and PHP will use it as a file. The individual process doesn't have to do any work. It will probably take longer to create the string, but read performance is much more important than write.

tmotyl commented 7 years ago

@joshuaadickerson I'm sure you agree that it doesn't make sense to argue about the feeling what "should" be faster and why. Please provide benchmark proving your solution is faster then the current one. Thanks