Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114614 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75578 invoked from network); 26 May 2021 11:38:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 May 2021 11:38:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0AAE51804C3 for ; Wed, 26 May 2021 04:49:50 -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-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 ; Wed, 26 May 2021 04:49:49 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id k16so635098ios.10 for ; Wed, 26 May 2021 04:49: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=KmEAwrL6PIcffPxVMZbw2FsXc4Am+4y+L876v8psQTE=; b=ufHOJRXcZr5MTND72nQjssnMqBUTdzlUHW434GthbXqkdkAvznOeLoI5JiVZEo4wxe W8xhPdYilwx9vNqN/bWH0o0uPRhgMvDE2iCGjVnfqGD3PcOYBzk+kf29CFzGLKNxbWQ5 gQS9HpJsWpgvKvIb0590RxN5Z+5rdj3xXOW5HjVorrsM0g0BzMbnG4HzrEi5F8sxf7Mg 2pBz4SR/SrXbbDs1sFA1aPdml5Rfl2IhWwLH3Cuh8TzTe3iV+ZQ6zd3n9j+v/u5SVnF8 fJa+bgEqrNlw39z/TzBXPX7t5BoNLqMl8dbcae89yM6rk8zLrGXJNJ7y/JrZe1TeZrnM BfRQ== 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=KmEAwrL6PIcffPxVMZbw2FsXc4Am+4y+L876v8psQTE=; b=I/NJDaJAFo8/j0ere0GLifc8pGlrdEaVjL/Sp/KL08pHzWo4aZz+vFv+8RHQMvMt03 7NTbLghcJmDF9yUmqXjUKTDlyOmTT6JwOnKYzMLGoizJjyMKU64Bwlk7/P7oSnD93cfd fEur/rHQKSVmteMkTtC6BVrUFpDIsPGOaaW2xFiMKDUIuXxFmZ6xbp4E9ganW/ivgHMh p2T1g3lp9t8Fn+D48GwqdYxnRZfmvVdpR/oEwngAJMdNvcLQBssRgUpK3XH3Pq/F+YCR DSPn2kj8FvT1pncLzLGwQk/ZQ246SOSLKxa0I8jLXcpfbB72lupeFHEB/toZ19T5kAuG pbMA== X-Gm-Message-State: AOAM531QWu9XCIesQdk2pARLf5ZNs77lR/KdoenpZHaYeBqUpsGw38Ln 2WHD2/FxJ9qXlLGIMDoCivwDNm5/tH7PJaTurJc= X-Google-Smtp-Source: ABdhPJy17E9KuCmO5tIjoiXqzLXkGjxvAbh+2I8Cr8jAGbltIbCEaaQT5IaU0Z0cVv9LO/WGKhZBJqN+uOZJwZ7oVfE= X-Received: by 2002:a5d:9842:: with SMTP id p2mr24055365ios.132.1622029786065; Wed, 26 May 2021 04:49:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 26 May 2021 13:49:34 +0200 Message-ID: To: Joe Watkins Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000036add105c33a3d54" Subject: Re: [PHP-DEV] Consensus Gathering: is_initialized From: ocramius@gmail.com (Marco Pivetta) --00000000000036add105c33a3d54 Content-Type: text/plain; charset="UTF-8" Hey Joe, On Wed, May 26, 2021 at 12:56 PM Joe Watkins wrote: > Hi Marco, > > What do you mean by "meaningful benchmarks" ? > > There's no question that is_initialized will be faster than the reflector > version, even with reflection caching. > Ack, but real-world impact seems irrelevant? I've worked on stuff that heavily relies on checking initialized state, and most of it is mostly unaffected. "meaningful benchmark" means "here's a use-case that really needs `is_initialized()`, and absolutely cannot run into the penalties of `ReflectionProperty#isInitialized()` > Here's a naive bench: > https://gist.github.com/krakjoe/cef6452281624bdf1b46788f52a01521 > > krakjoe@Fiji:/opt/src/php-src$ sapi/cli/php initialized.php > is_initialized: 0.04558 seconds > reflection: 0.07186 seconds > > However is_initialized has a narrower scope than the reflector version, as > mentioned in the PR, it specifically can only work on typed (accessible > from calling scope) properties. > Sounds weird? Why would a narrower version be needed at all? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ > --00000000000036add105c33a3d54--