Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113092 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51175 invoked from network); 5 Feb 2021 14:39:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2021 14:39:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AFD13180539 for ; Fri, 5 Feb 2021 06:23:06 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 ; Fri, 5 Feb 2021 06:23:06 -0800 (PST) Received: by mail-ot1-f44.google.com with SMTP id i20so7010845otl.7 for ; Fri, 05 Feb 2021 06:23:06 -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=gwvDnhvNfkEbK5hGvTNtzAYQ4maJ7/xLXmczCIgmHfo=; b=Sl8JCNs9m10WPw0FUbbBKPcys4mL2PnKJfb7ZOBHXmmMgDGDLONcKdelRoDke6EAac xgr9l0Tnc2FUkfJLWYt58KG7uAoUNBlaGaaMHo9yHba6Nr8CjYPCF+iGHmYqBAfUp3H5 6kDXMm5k6pf5P3O3d8J/qq+CEuVqYeHjPJX24rdj7nczPSdTljHhNH/dEveLYV80pst4 qCms2RBw3igL5rHdX3l2bS2JW90Q/cIusWRrADpROU2IbxC3+euKng4BxyBDl6z6ypcm UUUEdsCU458TjIok0Vs4+dCowFuUKWxu/JZiZkcz4ixyCQu2MngzomBwwqa4ZX2a2y2q yAKw== 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=gwvDnhvNfkEbK5hGvTNtzAYQ4maJ7/xLXmczCIgmHfo=; b=ObGvLjSS/TJe84JzJZgP1vqQlL+C8YHm6y6aS+uv7rFxhaEtfQ2kcbe4CJ3hF9UysQ x0GSIRHkSvkDBeAcNi1DeSPJaWxmYsdPS3Ddeg8Qd7vkwrHvRA7XaBTBPO0+TPzYriPO IOi7RqqzazWWkBdveDBWDQtGKk/1aoSI1UowG8H5U3++3KcKiJwevZsjnCjSywVXp2Ds Ihgmti+8x7gkF6wjdK9gcqkz51PGlpmQCJATExMTFp6MXH9zcWMEd6PgDNtqQUhgdkPr TuqpQPa9jOBAIR82nL8WBX6lPlyH0nG5DnDJs3vXyvhyX7K3sKMgOrUquXpEI8zzWUSh Jz9g== X-Gm-Message-State: AOAM532JekfuLWWijxKnJzXySD1v1r9mo/7zjeUiKx/u9LIC6BI4r7Ih Z3rcpQLEjjXOBMPwl3+i4S1v+0PS/0P+f3rTbfU= X-Google-Smtp-Source: ABdhPJwoDvGIhB5QA/nSoFc/SEnENcbbzz4HjLoJjwFjnbRWmaMtZHp8VObqzIfAp5jpPj6ZgdVeoH8VgkCsGNifwmM= X-Received: by 2002:a9d:6d85:: with SMTP id x5mr3535751otp.135.1612534984695; Fri, 05 Feb 2021 06:23:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 5 Feb 2021 15:22:53 +0100 Message-ID: To: Dmitry Stogov Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000f3650505ba978e23" Subject: Re: [PHP-DEV] Inheritance Cache From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000f3650505ba978e23 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 5 Feb 2021 at 15:03, Dmitry Stogov wrote: > Hi, > > I'm glad to present the result of my recent work - Inheritance Cache. > > https://github.com/php/php-src/pull/6627 > > This is a new transparent technology that eliminates overhead of PHP clas= s > inheritance. > > PHP classes are compiled and cached (by opcahce) separately, however the= ir > "linking" was done at run-time - on each request. The process of "linking= " > may involve a number of compatibility checks and borrowing > methods/properties/constants form parent and traits. This takes significa= nt > time, but the result is the same on each request. > > Inheritance Cache performs "linking" for unique set of all the depending > classes (parent, interfaces, traits, property types, method types involve= d > into compatibility checks) once and stores result in opcache shared memor= y. > As a part of the this patch, I removed limitations for immutable classes > (unresolved constants, typed properties and covariant type checks). So no= w > all classes stored in opcache are "immutable". They may be lazily loaded > into process memory, if necessary, but this usually occurs just once (on > first linking). > > The patch shows 8% improvement on Symphony "Hello World" app. > > I'm going to merge this patch into master on next week. > Please review and give your comments. > > Thanks. Dmitry. > Hi Dmitry, that sounds awesome, congrats for this work! If I understand correctly, this only offers performance improvements when the classes are not preloaded, and thus closes a bit the gap between preloading on & off? =E2=80=94 Benjamin --000000000000f3650505ba978e23--