Re: Method call overhead

From: Date: Wed, 03 Jun 2015 22:33:51 +0000
Subject: Re: Method call overhead
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 6/2/15 22:30 , Bishop Bettini wrote:
Hi! I've measured the overhead for method calls in a variety of environments (Amazon, Travis, and 3v4l). The results are reliable and here's 3v4l <http://3v4l.org/NsjJR>. Some observations. First, as expected, direct calls are faster than static object calls, which are faster than object calls. Second, in absolute times PHP7 outperforms HHVM3 substantially. Kudos, really impressive. My question though is on relative times. Method call overhead is consistently 50% to 150% over a direct call. Is my experiment invalid, or is this overhead expected? Is the overhead in the allocation, deallocation, GC? Cheers, bishop
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 -- Brian. -------- http://brian.moonspot.net/

Thread (12 messages)

« previous php.internals (#86480) next »