Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69133 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81813 invoked from network); 15 Sep 2013 19:20:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2013 19:20:58 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.171 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.223.171 mail-ie0-f171.google.com Received: from [209.85.223.171] ([209.85.223.171:61967] helo=mail-ie0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/10-15236-89806325 for ; Sun, 15 Sep 2013 15:20:56 -0400 Received: by mail-ie0-f171.google.com with SMTP id at1so5912967iec.2 for ; Sun, 15 Sep 2013 12:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=Lx/HDFbqx+gQIaUgs2ih4OX3jgTSLNxCXkiWcDNEpLE=; b=QAt92Jwr/U8NT+ejjestYsvt2s2mnHaKKAaQUIZma4vKPJFGvTSNg+ktqukXGYBum5 1t8UxooNg185ej8wVGkXqV4fo0uKazBvd0VJM9cy4+0csBKJhZ9PF45Cq5J+7hySQZWm eC07mNLZb9hNTu9XTVFi5qLWEorga6TGPnjCPTcQFxbPEd7W3Yj4Th0RhDr4q3oxmuY4 Qj6SK0g9dd1oPrniJApRpEfHEE2iqnWLI/pdzWdn51Yh79zewLwAakkpAOB31O1emInB GNVj/E7z/PnlZ2hopPwmkT9wfadjcZIfiliovUL7iuLTuUn4rjUlOr2WJ4B/awcdP66y 2hCg== MIME-Version: 1.0 X-Received: by 10.50.61.241 with SMTP id t17mr5125717igr.28.1379272853538; Sun, 15 Sep 2013 12:20:53 -0700 (PDT) Sender: jakub.php@gmail.com Received: by 10.64.11.7 with HTTP; Sun, 15 Sep 2013 12:20:53 -0700 (PDT) Date: Sun, 15 Sep 2013 20:20:53 +0100 X-Google-Sender-Auth: rZmfVE-xSa1d4Y5ChHnZMD5ofr4 Message-ID: To: PHP internals list Content-Type: multipart/alternative; boundary=047d7bdca9687bcdaf04e670fc3e Subject: New internal serialize API for extensions From: bukka@php.net (Jakub Zelenka) --047d7bdca9687bcdaf04e670fc3e Content-Type: text/plain; charset=ISO-8859-1 Hi, We discussed adding a new serialize handler some time ago. That didn't seem like a good idea and it concluded in my initial RFC for the new internal serialize API. That API didn't have any patch and wouldn't fit to the current API for serialization. So I decided to completely redesign the proposed API. The resulted API is in updated RFC: https://wiki.php.net/rfc/internal_serialize_api I also created the patch that implements it: https://github.com/php/php-src/pull/453 The API is only for extension and does not change anything in user space (of course I run all tests to make sure that it's really the case). The changes are internal (just for extensions :) ). That's way I created an extension that tests the API. All results and examples are available at https://github.com/bukka/php-extest/blob/master/doc/serialize.md The tests are giving performance boost over 100% for the most useful scenarios. The main candidate (where the new API could be used) is DateTime and possibly other date objects. There are probably more extensions that could use it (I need to have a look). I would be happy to prepare patches if this proposal made it to the master branch. ;) I am not the best RFC writer so I am not sure if the text explains everything correctly. Please let if there is anything that is not understandable. I will be more than happy for any feedback. Thanks Jakub --047d7bdca9687bcdaf04e670fc3e--