Boost Your PHP Performance with igbinary

Discover how igbinary enhances PHP data handling with faster speed and reduced size, making it a superior alternative to the standard serialize function.

igbinary is a powerful alternative to PHP's standard serialize function, boasting significantly faster speeds and even smaller data sizes.

Key Features

  • Data serialized with igbinary is generated in binary format
  • Ideal for caching in systems like Memcached, APC, Redis
  • The more complex the data structure, the more space you save compared to serialize and json_encode

Comparing with the serialize Function

When we look at benchmarking, it's not just the speed that's impressive - the data size reduction is even more notable.

How to Install

To get started, follow these steps:

$ git clone https://github.com/phadej/igbinary.git
$ phpize
$ ./configure CFLAGS="-O2 -g" --enable-igbinary
$ make; make install;

Then, configure your PHP setup by adding the following to /etc/php5/fpm/conf.d/igbinary.ini:

extension=igbinary.so
session.serialize_handler=igbinary
igbinary.compact_strings=On

More on this topic