Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112759 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2322 invoked from network); 5 Jan 2021 11:37:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2021 11:37:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2FDC41804DD for ; Tue, 5 Jan 2021 03:13:50 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 5 Jan 2021 03:13:49 -0800 (PST) Received: by mail-lf1-f52.google.com with SMTP id h22so71755405lfu.2 for ; Tue, 05 Jan 2021 03:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UuW75l9flOEN0LDdsmYXCqbt5LcVlQzw2ElQcc/MR3A=; b=m/AV3skr7n7Jc1R5Cfeqq31qJzR5Q+YuBGVj6Ne/e6eeHIwyXr/KKPUEfKamw1tUfd i1tl+YrgjE4K4ZYUM0WJ0z9MpXTeFlSlqsGm4XTLTqKtWXJATF5lbr05y6T2mlF3F7SR MIekvL3jxnOWQCQ7gPLSCTJuDRdFrpDFk+7uofyCzxdJvr/x88FCItxknYX1vGMtyH8E XeWQGByZykEyrY9KvML+4w/Pf8OpVPTaRmCkkjxqzq0dkg7Gtv/fKHpWUnKz/tKh3kW8 620KmIFGWb448vtzxSpD0V+EZ6elZqu3KglvXafcC2btik2hrOKv/IYKKCYGiAf3dGes eriA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UuW75l9flOEN0LDdsmYXCqbt5LcVlQzw2ElQcc/MR3A=; b=OrOoVrhbuq+6QHx0AlfuKXGXEwGvvDb0TFC9mOgQRbjG+JonbRMp98ZqSmDFqezgsq K9o0UUgRM+whInVbRIOZwaOTI5TTLq8dEDqmmd+HvjcPOVLjmwJj9FPpS2PHzdeBP1Gy gr9a3h5EgCRXWCCMWaDmjBsYR+rjI8H8WsTggBHbXjhRjoyXGBvZbexS9luVMohcnfbh KT8ss1204oGKLTBEWm+epkzWrISj6VASiENhmmnVi8t28n3LavGs9njeF1rMLsnjY5sm mKKVUz5HoiF7Km3GN2+bEaVFVndrLQWGNbPbVDqwi8ivJcDToUevlJ19Q9CPH/FqbKS9 lOpQ== X-Gm-Message-State: AOAM533OjcqU+jWnAfgiZxtn6c9Gijvn2Vu8tdiPf9mH92CQ9d+q0iuf NGOnguV2dEk6pqw9zopTFNplmxzvJnMMiw2wPHY= X-Google-Smtp-Source: ABdhPJzlYgerCYuZMXjt+6rqc/qUlWcxKCjZq417hF31kreYV6ftTI3Op1hWqUYsvZESiooXIASFaw8lhd0adi/AHRU= X-Received: by 2002:a19:2d0a:: with SMTP id k10mr15340084lfj.286.1609845226169; Tue, 05 Jan 2021 03:13:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 5 Jan 2021 12:13:30 +0100 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d9685605b8254c11" Subject: Re: [PHP-DEV] [RFC] Bundling ext/simdjson into core From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d9685605b8254c11 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 29, 2020 at 5:58 PM M=C3=A1t=C3=A9 Kocsis wrote: > Hi Internals, > > I think this will be my last proposal for quite some while :) > But this time, I'd like to propose bundling the > https://github.com/crazyxman/simdjson_php extension > with some major modifications. > > The proposed OO API is included in the description of the > PR that I've just created: https://github.com/php/php-src/pull/6551 > > The main motivation behind this RFC is two-fold: > - the underlying simdjson library (https://github.com/simdjson/simdjson) > which is used by ext/simdjson provides huge performance gains > compared to ext/json (see some benchmark results in the PR) > - we can support new use-cases, most notably the so called "on-demand" > parsing: https://github.com/simdjson/simdjson/blob/master/doc/ondemand.md > (This is not implemented currently) > > Originally, I planned to include the new API in ext/json, but > unfortunately, > simdjson is written is C++, so it would make C++ as a hard dependency, > which was not the case so far. That's why I opted for creating > ext/simdjson. > > Please let me know if you have any feedback. > > Regards: > M=C3=A1t=C3=A9 > Same as the others, I don't think it makes sense to bundle this at this point in time -- though I'm also pretty skeptical about bundling it at all. The end result would be that we have two JSON APIs, one that is always available but slower, and another that is optional but faster. That is really not great. Would make a bit more sense if simdjson was just a backend that could be optionally enabled to speed up the normal JSON API. I'd also be concerned about compatibility -- JSON parsing is a bit of a minefield and many parsers have subtle differences. I remember this comparison page http://seriot.ch/json/pruned_results.png which showed that PHP 7 (which is when we switched to jsond) had one of the only fully conforming JSON implementations. It doesn't seem unlikely that simdjson will have differences somewhere, and it would be unfortunate if there were two JSON APIs with subtly different behavior. I think the main value proposition (even though it is not part of your initial proposal) here would be a streaming JSON API, that does not require parsing or even loading the whole JSON document at once. I think the addition of such an API would be valuable -- but wouldn't it be possible to introduce this based on our existing JSON parser? Nikita --000000000000d9685605b8254c11--