Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28944 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39214 invoked by uid 1010); 21 Apr 2007 07:30:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39199 invoked from network); 21 Apr 2007 07:30:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2007 07:30:40 -0000 X-Host-Fingerprint: 88.64.141.12 dslb-088-064-141-012.pools.arcor-ip.net Received: from [88.64.141.12] ([88.64.141.12:29364] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/B4-18102-F9DB9264 for ; Sat, 21 Apr 2007 03:30:40 -0400 Message-ID: <0E.B4.18102.F9DB9264@pb1.pair.com> To: internals@lists.php.net Date: Sat, 21 Apr 2007 09:30:36 +0200 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 88.64.141.12 Subject: serialize and cache handling From: phpinternals@thunder-2000.com (Mathias Bank) Hallo, I use pear cache (light) to save calculated values. The package uses serialize to transform the content of a variable into a writable form. This transformed value will be saved to disk. This could be improved! Would it be possible to rewrite the serialize function to make it possible to write directly to disk? If you have a value, which needs 10MB you need also ca. 10MB to serialize and than you can write this data to disk. So, you needs 20MB. If serialize (and of course unserialize) would be able to write directly to disk (or read directly from disk), you only needs 10MB. I think, that could perform much better for every file cache than current implementation does. I have such a scenario, in which a variable needs 100MB. Because the calculation of this value needs much time, I wanted to save this value to cache (with the help of (un)serialize). But than, I need 200MB and that doesn't look nice, because it is not really necessary. As I understand the serialize structure, it would be no problem to extend it to directly save to disk. But my c knowledge is not as good as it should be. I would be very happy, if this idea could be realized. Mathias