Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79640 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50624 invoked from network); 14 Dec 2014 19:39:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2014 19:39:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.178 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.223.178 mail-ie0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:64409] helo=mail-ie0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/E0-45071-557ED845 for ; Sun, 14 Dec 2014 14:39:02 -0500 Received: by mail-ie0-f178.google.com with SMTP id tp5so9681489ieb.37 for ; Sun, 14 Dec 2014 11:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=RbY1daX5EsmYriY53SHtD7NoH5ooui74SRW+GjN5Zlw=; b=i4NKYfFVnkJWIyQ5MTn105gjTx7Hy3z1e2TwuO7i4om5UeoyrRyVhRssrKtn2r5dN2 p9VWf39x9hQx9theUeSXwgKhV0qJdlgOfKY/g6UJzQ97Ims8FLCutDuAaBiWRn6t/hno w9YHj+uNtSq8FzDGX8PoShIHzysCmRWWLOiHSlqtu7A/DQTaAVigNp5FRVf0udst2LxM 7I0W7LLHF2ONjG33H+ssYmre6OsrXmIuwCydJ8Yqo66OMVAQfZbbyhv9P/CKko7ftB8x WJBqzZzOjeNh+UkomQ8dee9mRLgwek5hZkna7UzCnrV23osa8HRBDiMCn+WDUF567HpK 0fRg== MIME-Version: 1.0 X-Received: by 10.107.15.73 with SMTP id x70mr25158533ioi.8.1418585938420; Sun, 14 Dec 2014 11:38:58 -0800 (PST) Sender: jakub.php@gmail.com Received: by 10.107.11.30 with HTTP; Sun, 14 Dec 2014 11:38:58 -0800 (PST) In-Reply-To: <5487EB7C.7040708@fedoraproject.org> References: <543A1CB9.9040205@fedoraproject.org> <5487EB7C.7040708@fedoraproject.org> Date: Sun, 14 Dec 2014 19:38:58 +0000 X-Google-Sender-Auth: pwPVSjq-hAi4HuucdC7UNwMPqJk Message-ID: To: Remi Collet Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a113e8678f16a17050a3246a1 Subject: Re: [PHP-DEV] PHP 7 and json From: bukka@php.net (Jakub Zelenka) --001a113e8678f16a17050a3246a1 Content-Type: text/plain; charset=UTF-8 Hi, On Wed, Dec 10, 2014 at 6:43 AM, Remi Collet wrote: > > > The main issue is the "non-free" decoder. > > Agreed. > Of course perf can be considered as an issue (I think minor). > jsonc have bad perf, but is free. > > If jsond have nearly same perf than old one, it's enough. My initial benchmarks (for PHP5 jsond ext) actually shows better performance for json instances containing strings. Pure int and floats are more or less the same. But need more benchmarks to confirm that. > > Just a quick update on jsond. The decoder is mostly done. > > So, please go on I have ported a decoder to PHP 7. The code can be found on my github php-src jsond branch ( for code changes see https://github.com/bukka/php-src/compare/jsond ). It's just a replaced decoder. The encoder is the same though. All tests are passing for me... I haven't done any perf tests as yet. There is a big room for improvements but it's a good start IMHO. I'll have more time during Christmas so I would like to improve the code and do some benchmarks. Think we could have RFC around New Year... > > > I have been recently working on optimization for the encoder. I > > already have over 30% speed improvement in encoding for string > > based arrays/objects like $_SERVER. It's generally much faster now > > but there is still a big room for other impromevents. I also > > experiment with a new buffer (replacement for smart_str in json > > encoder). It needs lots of optimization but it already gives better > > numbers for some cases. However it also gives worse numbers for > > some other cases like processing small integers so I need to play > > with it a bit more. As I said before I need a better set of > > benchmarks to be sure that it works fine for a big number of json > > instances. > > Current encoder is not an issue. > Perf. can be manage later. > > And I don't think we should use another string management for json > encoder, so if improvment is possible, should go in smart_str. > > Yeah I won't go there (replacing smart_str). It's still experimental and it would delay the whole thing quite a lot. I'll rather add just few proven improvements that are already done in jsond and that are not breaking ABI. Cheers Jakub --001a113e8678f16a17050a3246a1--