News 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

Till Klampaeckel's Blog: APC: get a key's expiration time

Christoph Dorn's Blog: TIP: FirePHP data volume filtering

DevShed: Working with Prepared Queries with PDO Objects in PHP 5

Raphael Stolt's Blog: Handling JSON responses on the client side

Duckout Blog: Do Funny Stuff with the Google Charts API and PHP


Community Events





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


podcast bugfix community code series framework zendserver laravel development threedevsandamaybe list conference release language deployment introduction interview symfony tips api

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