Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113123 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48873 invoked from network); 9 Feb 2021 05:55:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Feb 2021 05:55:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E1921804D1 for ; Mon, 8 Feb 2021 21:40:42 -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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from srv015.mail.ichtushosting.com (srv015.mail.ichtushosting.com [159.69.182.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Feb 2021 21:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stitcher.io ; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=9+cir5SVCPonRVdhcdKI+FSG4LWGnA85vtni3UnEZzQ=; b=UtQ1S9z3TYdrJCUvf1qGwdn3Kv 3cHWRI7iFOcJbm0iPNjeKJNGjD0yxYnyVLAo3ckTrTU6f5mcY3Eo9wntd+TixZkFzRiBxdjKGN/R2 7hpol5qKL3Xg6i7p8xb+gJPrfunAOLbeKNfgJDGr9RnF8MHxWj0KF/FgVguHNhMfWpF2puyDVecD9 GFV+OK/MSHGT3vXdH0UbPNQE1eQhd/bTjjWYtH1UuOJxUWruQu7dE1FX73GCKlX4uysL03ivNQgKg cRskvCRtbGfQt+xCxb/28HoBqG8QQhyVh1V+ngfpPugbHRM2N8X6v4NEoUip6JpfI0fKTanOSSs5l 7X/grN1g==; Authentication-Results: srv015.mail.ichtushosting.com; iprev=pass (srv021.web.ichtushosting.com) smtp.remote-ip=78.47.76.72; spf=softfail smtp.mailfrom=stitcher.io; dmarc=none header.from=stitcher.io Received: from srv021.web.ichtushosting.com ([78.47.76.72]) by srv015.mail.ichtushosting.com stage1 with esmtp (Exim MailCleaner) id 1l9LlM-0007Pr-BS from ; Tue, 09 Feb 2021 06:40:36 +0100 Received: from ptr-fq9pjpjo6v7wgd87dy5.18120a2.ip6.access.telenet.be (ptr-fq9pjpjo6v7wgd87dy5.18120a2.ip6.access.telenet.be [IPv6:2a02:1812:c3c:3a00:ed30:546a:7ce8:9e5d]) (Authenticated sender: brendt@stitcher.io) by srv021.web.ichtushosting.com (Postfix) with ESMTPSA id 70CCD23CC5; Tue, 9 Feb 2021 06:40:33 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Tue, 9 Feb 2021 06:40:32 +0100 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <3A0832D2-F886-4F21-B16B-1B660BC0FB91@stitcher.io> References: To: Dmitry Stogov X-Mailer: Apple Mail (2.3654.60.0.2.21) X-MailCleaner-TrustedIPs: Ok Subject: Re: [PHP-DEV] Inheritance Cache From: brendt@stitcher.io (Brent Roose) Hey Dmitry Out of curiousity: how does this compare to preloading? =46rom what I = understand preloading also links classes, which was one of the most = important differences between preloading files and simply storing them = in opcache. Does this change mean that preloading becomes much less = relevant since class linking can now also happen at runtime? Kind regards Brent > On 5 Feb 2021, at 15:03, Dmitry Stogov wrote: >=20 > Hi, >=20 > I'm glad to present the result of my recent work - Inheritance Cache. >=20 > https://github.com/php/php-src/pull/6627 >=20 > This is a new transparent technology that eliminates overhead of PHP = class > inheritance. >=20 > PHP classes are compiled and cached (by opcahce) separately, however = their > "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 = significant > time, but the result is the same on each request. >=20 > Inheritance Cache performs "linking" for unique set of all the = depending > classes (parent, interfaces, traits, property types, method types = involved > into compatibility checks) once and stores result in opcache shared = memory. > As a part of the this patch, I removed limitations for immutable = classes > (unresolved constants, typed properties and covariant type checks). So = now > 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). >=20 > The patch shows 8% improvement on Symphony "Hello World" app. >=20 > I'm going to merge this patch into master on next week. > Please review and give your comments. >=20 > Thanks. Dmitry.