Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86482 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44357 invoked from network); 4 Jun 2015 04:36:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2015 04:36:58 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.177 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.214.177 mail-ob0-f177.google.com Received: from [209.85.214.177] ([209.85.214.177:36547] helo=mail-ob0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/A0-32964-4D5DF655 for ; Thu, 04 Jun 2015 00:36:36 -0400 Received: by obbqz1 with SMTP id qz1so5931097obb.3 for ; Wed, 03 Jun 2015 21:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=8cJ+qiKzO2YjlschrNTTddxRfoM2cNRKqf3PHCiYJ0w=; b=e9zVpWc4a/Ex5y4813HV4pMh92dfTLFFddiH/hXQB4hDGBLY+ylFL2RbgMLf5fUOrV 8BDjnG7isHGfFULc7OIKFgFydDU4Dd4/Ud3C9ics1nCMR2i96h6gg1KEfZJ5yPwGKRYs 6jikwq10nmqr+tVWjJuZ0C/U2bNwFjqtqN+YV9Y5qRWShkwsA93cnOJ0undD2k2jaPIH TSOp6QjYIdP85tPinK20LHRf7Aba0OekCM3bCKXQT7d5ukpmDsn5GYjUhOM7o2H6PZiy hAbLoxbC5H9ir9MguXwW1YQVjtsPk7eGOwNjVshf+eXcJIYbIxvlfLq73ux8VDfiE0Nh 0mPQ== X-Received: by 10.60.55.36 with SMTP id o4mr2994071oep.0.1433392593634; Wed, 03 Jun 2015 21:36:33 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.170.196 with HTTP; Wed, 3 Jun 2015 21:35:53 -0700 (PDT) In-Reply-To: <556F80CF.40303@moonspot.net> References: <556F80CF.40303@moonspot.net> Date: Thu, 4 Jun 2015 13:35:53 +0900 X-Google-Sender-Auth: cWQKWibh-4QUh4Whknh3x51QWmI Message-ID: To: Brian Moon Cc: Bishop Bettini , PHP internals Content-Type: multipart/alternative; boundary=089e013a1a5c5e0e7d0517a9b8d9 Subject: Re: [PHP-DEV] Method call overhead From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e013a1a5c5e0e7d0517a9b8d9 Content-Type: text/plain; charset=UTF-8 Hi Brian, On Thu, Jun 4, 2015 at 7:33 AM, Brian Moon wrote: > This is a better representation of what you are trying to show. It removes > all the magic call back stuff that could be adding to the slowness you are > seeing. In addition, it does not create a new object on every call for the > object method. Creating a new object is going to explicitly slow things > down. But, it's not related to the call time. > > http://3v4l.org/biM9G > This version adds up precision errors because microtime() precision is not high enough for the purpose. Since the error is random, it does not affect proportion much but total execution time. Following damn code does better job for these kinds of benchmarks. http://3v4l.org/eJK07 See the total amount of execution time recorded. If we really need pure execution time, then it should record "for loop" execution time with empty body. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e013a1a5c5e0e7d0517a9b8d9--