Re: Method call overhead

From: Date: Thu, 04 Jun 2015 09:01:19 +0000
Subject: Re: Method call overhead
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On 06/04/2015 06:35 AM, Yasuo Ohgaki wrote:
Hi Brian, On Thu, Jun 4, 2015 at 7:33 AM, Brian Moon <[email protected]> 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. -> incl. displaying the time for the loop: http://3v4l.org/1vZJI
Regards, -- Yasuo Ohgaki [email protected]


Thread (12 messages)

« previous php.internals (#86486) next »