chdb is a read-only hashtable shared across PHP processes: Probably the fastest and less memory-angry one.
Hidef allows to define constants using a .ini file. The constants are defined once, when the php module is started.
APC can store variables in shared memory, so that they are available to other PHP processes. It has the overhead of serializing and de-serializing variables each time you store and fetch them.
If you dont have APC or Memcached installed already (or dont want to use them for this) you can also create a RAM disk. Then use file_get_contents() and file_put_contents() where filename is your key and the file content is your value. I dont have numbers for that, but it should be fast.
chdb is a read-only hashtable shared across PHP processes: Probably the fastest and less memory-angry one.
Hidef allows to define constants using a .ini file. The constants are defined once, when the php module is started.
APC can store variables in shared memory, so that they are available to other PHP processes. It has the overhead of serializing and de-serializing variables each time you store and fetch them.
See others: http://pecl.php.net/packages.php?catpid=3&catname=Caching
If you dont have APC or Memcached installed already (or dont want to use them for this) you can also create a RAM disk. Then use
file_get_contents()
andfile_put_contents()
where filename is your key and the file content is your value. I dont have numbers for that, but it should be fast.APC http://php.net/manual/en/book.apc.php
You can use it for optimizing and caching (intermediate) PHP-code
Read this: http://blog.digitalstruct.com/2008/02/27/php-performance-series-caching-techniques/
If your don't intend to modify data (probably true for your configuration files) then use chdb.
Specific example:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php
If you're in multi-server environment, then go for Memcached.