Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97131 invoked from network); 8 Aug 2018 17:11:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2018 17:11:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@majkl578.cz; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mail@majkl578.cz; sender-id=pass Received-SPF: pass (pb1.pair.com: domain majkl578.cz designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: mail@majkl578.cz X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:34115] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/28-18754-E542B6B5 for ; Wed, 08 Aug 2018 13:11:58 -0400 Received: by mail-wm0-f53.google.com with SMTP id l2-v6so78220wme.1 for ; Wed, 08 Aug 2018 10:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majkl578.cz; s=google; h=mime-version:sender:from:date:message-id:subject:to; bh=IY2OZQlryZRjeWPH5zTnXqfZsqA5CcZ88aocY7LQf2Q=; b=IKN/VGSRAAzdpNNOIxEyXyOyZWBcXLzqoTkyexva1OBKqmPcuEkKwJr3eNPG3IIQR3 z48nzkVx+gYB6J8zO7lvK/d9/NfPItUuJ9IY0ndAnwtm4TWq4bTdCNO9tb54PAcXcIri af6DzCyqJFlsO0wi04/zNcHLxQexp6WDJjVfKBvcLKS3bx5MLIQtOvjq1d1Vt3r+QPxT 86WhIVmRj7etu75KdQ6u6ME96VFgmayVeSnTCuBK9+cBuZgqIwgCCszy6ISclMIYncRR xWZEN4vlzU9yYnQw6fxavDUXWko1R7mplezJzEQQUo/Fri+mQvqwnY/aiWt/zpgZoXCH TwhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=IY2OZQlryZRjeWPH5zTnXqfZsqA5CcZ88aocY7LQf2Q=; b=ZlTj6OlemEWgALPpvel497lhEi1G4y7jGh+vEpLhOAtU4KFc2QhPA8nEextLQKS2gi SJWyw8sYR6yewjxll856mh94dYsgap1IxjneGE6w7TmlQLjPKOHqO58vgjkUQEyH6mIx rFtITnDsek0XheaNPCB0vHJG+G4974qbl2kCZ7OhMp/+8LZL75HTma+xNPTKcAtUX4UW K3V9BS8ymM80Et3xDHmgLz20hFNZ/EnllGIkzVVOet5TzzL7a3+XR/nd8IU03ycr+iKC JopcJ/2n/bNFd43WpsSkm/F2wnMX293WJlSxj57CwP8QjQ0WryaFbakjJmuXYs3JgMuI SVZQ== X-Gm-Message-State: AOUpUlEC9SQCP6AH/yHYdPfIkanHhsE3R6MDFknk7TuuWatZbHQpKGl4 znRHdVCeygDeEMtUq/zd2/ybk9pKmsxUyvGR1XDqcLFkJ+YH2Q== X-Google-Smtp-Source: AA+uWPw2eMGlmTa/MkWX7TYTl9gIyfqSdm0Y0c7Uwr9ME5XC5ehjlarUtNtqQ0d2NmFb72i02mnUIRHY2DsUVeECLEo= X-Received: by 2002:a1c:497:: with SMTP id 145-v6mr2488507wme.157.1533748314961; Wed, 08 Aug 2018 10:11:54 -0700 (PDT) MIME-Version: 1.0 Sender: mail@majkl578.cz Received: by 2002:adf:e38e:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 10:11:34 -0700 (PDT) X-Originating-IP: [80.250.18.198] Date: Wed, 8 Aug 2018 19:11:34 +0200 X-Google-Sender-Auth: w7NZjW0XnX5rAOZ3JX8Xhw9yu8Y Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000007d135b0572ef9b4d" Subject: Eligibility of array_key_exists() optimization for 7.3 From: php.net@majkl578.cz (Michael Moravec) --0000000000007d135b0572ef9b4d Content-Type: text/plain; charset="UTF-8" Hi, there are some questions whether PR #3360 (Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists()) [1] could go into 7.3.0beta2 or not. This PR adds new opcode, but also significantly improves performance of array_key_exists(), to the point that it becomes faster than isset(). This function is often used in major OSS libraries and some of them use hacks with pre-checking using isset() to avoid the performance overhead of calling this PHP function. Language-wise it's similar to ZEND_COUNT or ZEND_IN_ARRAY - only a specific instruction with a VM handler to eliminate the function calling overhead. This new opcode may have some implications for extensions, though quickly grepping trough XDebug and PHPDBG source didn't reveal any specific handling for ZEND_COUNT or ZEND_IN_ARRAY. Do you think this optimization could still go into 7.3 so the PHP ecosystem could benefit from this improvement (possibly could be reverted in case of issues)? Or does it have to wait for 16 months? Thanks, M. [1] https://github.com/php/php-src/pull/3360 --0000000000007d135b0572ef9b4d--