PHP Serialization Performance

From: Date: Wed, 16 Apr 2008 11:04:34 +0000
Subject: PHP Serialization Performance
Groups: php.general 
Request: Send a blank email to php-general+get-273036@lists.php.net to get a copy of this message
I'm using PHP to cache files that are backed by the database. In the course of writing these functions, I end up with a set of variables that are needed by my application, returned in an array. I can either directly generate the array in a .php file, then use require_once to get that variable, or I can use PHP serialization, write that array out to a file, then in my application read the array in, deserialize, etc. I spent awhile trying to look at the performance of php serialization, but except for one unsubstantiated comment on the php serialize() doc page, I haven't found much. Does anyone have any knowledge of that, and also of the two approaches in general? The pro of the serialization is that I think it's slightly easier to write, but the con is that it's harder to read. Thanks!

« previous php.general (#273036) next »