Method call overhead
| From: | Bishop Bettini | Date: | Wed, 03 Jun 2015 03:30:05 +0000 |
| Subject: | Method call overhead | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-86471@lists.php.net to get a copy of this message | ||
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