News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Nitschinger:
Benchmarking Cache Transcoders in PHP
January 31, 2013 @ 11:31:01

Michael Nitschinger has written up a new post comparing a few different methods for serializing or translating objects to store them in a cache. In it, he compares the PHP serializer, the igbinary extension and translation to JSON.

Storing PHP objects (or simpler data types like arrays) in caches always requires some kind of transformation. You need a way of encoding/decoding data so that it can be stored and loaded properly. In most languages, this process is known as object serialization. PHP provides a mechanism for this out of the box, but in this article we'll also look at igbinary as a drop-in replacement for the default serializer. We also compare the results to object transcoding based on JSON, which is not really an object serialization mechanism but commonly used as a data chache structure which has its own benefits and drawbacks.

He goes through each of the three technologies and includes a snippet of code showing how they'd work in object translation. He also talks about things like the size of the result and the performance of each when the results are looped over. Based on the results of some of his "microbenchmarking" of each of the methods, igbinary came out on top, even faster than PHP's own serialize/unserialize.

0 comments voice your opinion now!
cache transcoder serialize translate object igbinary json


blog comments powered by Disqus

Similar Posts

DevShed: The Basics of Implementing Adapter Objects with PHP

Reddit.com: Question about the relevance of benchmarking

DevShed: Enforcing Object Types in PHP - Filtering Input Objects in PHP 4

ProDevTips.com: Memcached in PHP on Dapper

Stubbles Blog: Lazy loading of classes stored in a session without __autoload()


Community Events











Don't see your event here?
Let us know!


symfony2 project database hhvm unittest framework release language example composer security performance facebook hack introduction install package application component podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework