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.