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

SitePoint.com: How to Create an XML to JSON Proxy Server in PHP

Paul Jones' Blog: Solar 0.27.0 and 0.27.1 Released

Jan Lehnardt's Blog: CouchDb PHP Library for JSON API

Kevin Schroeder's Blog: Passing typed ActionScript objects to Flex using PHP and a message queue

DevShed: The Basics of Serializing Objects in PHP


Community Events











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


opinion hhvm language package security symfony2 performance composer support release component application introduction podcast overview facebook hack install framework unittest

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