php - APC caching files vs caching variables -


say have file a.php contains large array:

$client = array(     "a" => 123,     "b" => 124,     ...  ); 

apc caches file a.php mean exactly? caches opcode assignment only? cache mapping itself? or need explicitly put in apc cache?

thanks!

apc caches php file in byte code. faster intermediary between human readable code , interpreter ends executing. analogous compiling c/c++ file binary. array compiled in fashion load quicker if read form file.

accessing element in associative array in php constant time o(1) in big-o. adding element o(1). , large best store such arrays in database because uses less memory , more flexible. keep in mind every browser visits application going have own copy of array, if use database there 1 copy. instance if want key based on value you'll have iterate on o(n) (which slow), use of database faster.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -