Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111970 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20535 invoked from network); 1 Oct 2020 13:18:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Oct 2020 13:18:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE13B1804B1 for ; Thu, 1 Oct 2020 05:30:49 -0700 (PDT) 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-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 ; Thu, 1 Oct 2020 05:30:49 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id u8so6358568lff.1 for ; Thu, 01 Oct 2020 05:30:49 -0700 (PDT) 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=MqZbzeAyZMtt0mL4LR9M67DJk9FaIs27LdsBrVDLSvA=; b=arfC6thO0/KTlQfanvt0Bjd9fweSSeZ0hU+qFvtDPPKr6+b7e3gzCpvb4trCZlstPt pRjRB/eu4m13R1g1M9OSCAyjXo9aJxzCYhucTmxfGxxFMmh1w+BDxPavXPUK9auPMKoW whP/PXiVY9Oom33mcfGMIeG7b2wTS5B0BXuFJydImaBhgNjOrSbBbNnxz5VEXRbjCjpz Me8Y3Fa/tN8aJ/4CAg9bC4cLhljMkMmRfJScz/fPTa+MW2/gFMFYYPn30/qn4rudr1oj fNarvtY+n1DXAHRCCIS00oYig/innGO+5Js4CdMerIcTDY/EOp+EiRe31vYEdNrGFfop Y4dw== 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=MqZbzeAyZMtt0mL4LR9M67DJk9FaIs27LdsBrVDLSvA=; b=JyMK162oNY7bj+PO2VmLapr5+5PKz9DJozpWYMl6nIAq8aVdQSUgFShAZKObhEX2nN GwHn2c+noJId/iblwf1I0SbLehJWFwGrtAe2bI3GGllTpXNezlQrw/IA8p7yD2xddlgY f+vgQBY8AsI7TI93iih+iFoR18NhEm9GRkFoIHPFbbRa1ovkZQz9Yk6C4kOS6uvOQ7Rk 3wSxdsosMhcq5Dg4SMTCWth7DUTeh3ZZ3QLx1WuX8hwu4+oIQud/W2Y+MZlEVETs3EpJ l/vq1nYPpFIPuNdtcI+3x1MEhbvueUsixm+Lo7Sl/MOUa/ktqFP4ySpuwsiBCNqcRij3 MyZg== X-Gm-Message-State: AOAM531QzTHf1mKT2d5onb2vIZaMvbKTSDDrb+QswwEQ+jTRPr8MXvJD h99HAzFWr2tEu0JzejDd+7MzYW8kLT5HzQ0gfTM= X-Google-Smtp-Source: ABdhPJyhBhcQiUotb6q66p/042af1VESMbwlvdU6XQ92eKKqohP5r4ta4zgKKVkl/wV+JKHfhNpya8C2J5d8D47uKo8= X-Received: by 2002:a19:8789:: with SMTP id j131mr2380324lfd.90.1601555444658; Thu, 01 Oct 2020 05:30:44 -0700 (PDT) MIME-Version: 1.0 References: <940131FA-19B3-406C-8982-0AD276FD1879@gmail.com> In-Reply-To: <940131FA-19B3-406C-8982-0AD276FD1879@gmail.com> Date: Thu, 1 Oct 2020 14:30:28 +0200 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000005dfce905b09b2f42" Subject: Re: [PHP-DEV] RFC: execution opcode file without php source code file From: nikita.ppv@gmail.com (Nikita Popov) --0000000000005dfce905b09b2f42 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 1, 2020 at 1:44 PM Rowan Tommins wrote: > Hi, > > On 1 October 2020 10:36:20 BST, "=E8=82=96 =E9=91=AB=E9=91=AB" wrote: > >I commit a new request path, the request is about execution opcode file > >without php source code file > >this RFC provides similar to class file of java and pyo file of python. > >patch is: https://github.com/php/php-src/pull/6146 > > I'm sure someone who knows the internals better can clarify, but my > understanding is that PHP OpCodes don't currently have any stability > guarantee, so you can't rely on a binary taken from one version will run = on > another, even within a release. > > In order to be useful, this will therefore need two things: > > - a header in the file identifying the engine version it was compiled for= , > with an error raised on any mismatch > - a policy of how to manage that version number, and how users can know > which versions their binary files will work on > > There's probably a limit to how stable we can (or want to) make the VM, s= o > these files will never be as portable as a Java class file or .Net assemb= ly. > This is correct. PHP uses the "system ID" to determine whether it is possible to reuse compiled opcodes. This system ID is used by the existing file cache. The linked pull request however explicitly disables this check, which is not safe. And with that check enabled, this feature would probably have limited usefulness, as the cached file would be bound to a specific PHP patch release (and to some degree to which extensions are loaded). It would be good to know what the actual use-case for this is. If the goal here is to distribute pre-compiled PHP code without the source code, then this is not going to work without making the opcode format stable (which, I think, is pretty unlikely.) If the goal is improving cold startup performance, then I wonder what the benefit over the existing file cache is= . Regards, Nikita --0000000000005dfce905b09b2f42--