Re: Re: unserialize() bottle-neck

From: Date: Wed, 12 Jan 2005 23:18:31 +0000
Subject: Re: Re: unserialize() bottle-neck
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35477@lists.php.net to get a copy of this message
Justin Patrin wrote:
On Tue, 11 Jan 2005 20:18:48 -0500, Wez Furlong <wez@thebrainroom.com> wrote:
I found it much faster to spit out an array declaration and then use eval() to pull that data back in.
Or you could use var_dump() and an include. Along with a code cache, this would speed things up considerably.
I tried var_dump() and include(), that was much slower than unserialize(). Guess that, if a code cache does improve performances I could try to detect it, and if present use var_dump()/include(), otherwise use serialize()/unserialize()... Looks a bit weird to me though. IMHO the very best thing would be to use Inline_C for such critical routines. There I could write a C unserialize() function that's optimized for my kind of array. But, I'm not sure Inline_C is mature enough. Doesn't seem to be a very active project... Sad, if beta/stable that would be a great tool. I'd find it personally better to write mostly in php along with critical routines in C, than write the whole thing in C. Funny, it really reminds me of the beginning of the nineties when I wrote assembly modules to optimize my pascal programs ;-) -- og

« previous php.pear.dev (#35477) next »