Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113091 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49003 invoked from network); 5 Feb 2021 14:19:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2021 14:19:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BCF791804E1 for ; Fri, 5 Feb 2021 06:03:29 -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.2 required=5.0 tests=BAYES_20,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-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (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:03:26 -0800 (PST) Received: by mail-vk1-f174.google.com with SMTP id k1so1471169vkb.11 for ; Fri, 05 Feb 2021 06:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4tyOVwFQdQV4zXwmLDpbMge/TZ6RQsyiaMKWMD4+ZDc=; b=La3U2X0zt1Ooz2JSAnWgNjTGQxKrYklt2APTuJiUh5+nHsNoR8YEYIHg7AZO84fwiG 3m7udSKT/dL/WzEmEVn+1K9VA/zsPdG0O9iSeCl4XWdS9gNLpE6P0C0HGeh39cANVaAd FTHTXTcO1lHu/X78eaDelmlRdfId+43WGdfCdr/e3YcAxe1dzSCsOdtEePs3JWxWUct+ dWuoyEFYEI8tsSTltNAvus9fP6NhvOIUY3j8o6OcQw9RTos+saZz/e9z7rUAepSvKiAU xDuuzZ4MqJqzT/JqCvkwB6SSA6AtJhc8atlV6K8+0r/Rbs5RjX7eaSSMFTW63iyEEJ4C 3t0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4tyOVwFQdQV4zXwmLDpbMge/TZ6RQsyiaMKWMD4+ZDc=; b=Gebt10qhXQXZNe91RiGdWk2Dtb0NuNy9BKjEVrDQaf5XNAJx8q30A1w2RcGj9+Nvi4 qmUVkjEIE/oPZNGnRmmYZOP9/naY8LtIXEqI2cbvUwtWTp+yGQ/cJnasH7eHdp+afDPa 9f0r4Bul57LW/EAJpKdKk8c82FmxVGWlMkjJHQ2hMBMmVrpw0irUS9XPDH1ms7jVIIyp 1yr/rJanWSIHEm1ikTm/bda9eFRUj9Ud0NYJmdOtOLjy0Mbg1ICAl1HnKc6GSWF8zuM8 VW2a7+/WLfmVzljpHUeklAgoGhK6aUN/gZwer4s0Y2sdRFdyGE0dUUkUnF/FAifBDC/C K+LQ== X-Gm-Message-State: AOAM532FuKJj7cnglobXF3e2GBpJuNpPmarsRHoyFZFXX/p3KPp0we39 Pb2nvFVhzVm46ZmzOCly6gHI1u4zq2vFNtgiMSoA2AgMvT5sJg== X-Google-Smtp-Source: ABdhPJzd3mk9iNzBaBpOA6pXyWXhITzP1ya8YEdcvx9yOdDD1xXz0UUGHSDWwXn4vXh/JsJ6I4jp7RsTbIAOX7WxF3c= X-Received: by 2002:a1f:9c57:: with SMTP id f84mr2876600vke.2.1612533803665; Fri, 05 Feb 2021 06:03:23 -0800 (PST) MIME-Version: 1.0 Date: Fri, 5 Feb 2021 17:03:12 +0300 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="0000000000008e4c9b05ba9748fe" Subject: [PHP-DEV] Inheritance Cache From: dmitrystogov@gmail.com (Dmitry Stogov) --0000000000008e4c9b05ba9748fe Content-Type: text/plain; charset="UTF-8" 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 class inheritance. 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. 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). 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. --0000000000008e4c9b05ba9748fe--