Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52517 invoked from network); 14 Dec 2014 19:46:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2014 19:46:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=ingwie2000@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ingwie2000@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: ingwie2000@googlemail.com X-Host-Fingerprint: 74.125.82.53 mail-wg0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:38775] helo=mail-wg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/41-45071-F19ED845 for ; Sun, 14 Dec 2014 14:46:40 -0500 Received: by mail-wg0-f53.google.com with SMTP id l18so13034877wgh.12 for ; Sun, 14 Dec 2014 11:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=hKpBSuHxUhUmMFJ9AFuc4NQbrrZTx07nl78+OKGS/tM=; b=RMBFu7iZeV0XOdhAjkDpZCbbxZzkCYQrgegefy8kz3uEbDb3Ibm3io1HqBvUVzhTzP lVVA8NFtQGdhFNqylhDBBsFOaaDDHtuWYkXmoFsY6V7KrE1X5U3X0o2fXXpEQ6AYMuUC ONIaIgiOYKTq2epHSI28/evbX2Z+jZVj/DMCCcH4cFNfZM6Vt+lYidHskJVOBEqnSPY6 D/Md4WNt74uqLBhLY3aojek8VkIPfcfOlSKYQOIyZkHDOYWDIR7MmdzgbG5z6FLRVXOo 5f6UKQqnbkY0QF/9O4Di5jbz5i5HL32eaJrznHYzmhLMN+4lPurdB+RmKBjkCrJsbF+v bpZQ== X-Received: by 10.194.8.34 with SMTP id o2mr46734823wja.129.1418586395076; Sun, 14 Dec 2014 11:46:35 -0800 (PST) Received: from [192.168.200.47] (dslb-188-097-115-099.188.097.pools.vodafone-ip.de. [188.97.115.99]) by mx.google.com with ESMTPSA id ud4sm579995wib.0.2014.12.14.11.46.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Dec 2014 11:46:34 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_E377134D-D9DD-4696-9E6A-0F9D91F1C2F1" Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Sun, 14 Dec 2014 20:46:32 +0100 Cc: Remi Collet , PHP Internals Message-ID: <9B12C735-D384-42B1-9AE8-7E649D8C0F66@googlemail.com> References: <543A1CB9.9040205@fedoraproject.org> <5487EB7C.7040708@fedoraproject.org> To: Jakub Zelenka X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] PHP 7 and json From: ingwie2000@googlemail.com ("Kevin Ingwersen (Ingwie Phoenix)") --Apple-Mail=_E377134D-D9DD-4696-9E6A-0F9D91F1C2F1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I don=E2=80=99t know if you are interested in some other open source = projects that parse JSON, but have you looked at the decoder here? https://github.com/vstakhov/libucl It can parse more than just the JSON format - but it has some JSON = benchmarks attached and works really well - and is plain C. > Am 14.12.2014 um 20:38 schrieb Jakub Zelenka : >=20 > Hi, >=20 > On Wed, Dec 10, 2014 at 6:43 AM, Remi Collet = wrote: >>=20 >>=20 >> The main issue is the "non-free" decoder. >>=20 >>=20 > Agreed. >=20 >=20 >> Of course perf can be considered as an issue (I think minor). >> jsonc have bad perf, but is free. >>=20 >> If jsond have nearly same perf than old one, it's enough. >=20 >=20 > 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. >=20 >=20 >>> Just a quick update on jsond. The decoder is mostly done. >>=20 >> So, please go on >=20 >=20 > 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. >=20 > 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... >=20 >=20 >>=20 >>> 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. >>=20 >> Current encoder is not an issue. >> Perf. can be manage later. >>=20 >> And I don't think we should use another string management for json >> encoder, so if improvment is possible, should go in smart_str. >>=20 >>=20 > 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. >=20 > Cheers >=20 > Jakub --Apple-Mail=_E377134D-D9DD-4696-9E6A-0F9D91F1C2F1--