Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

anthon at piwik dot org
14 years ago
If you're wondering what the performance impact of using the @ operator is, consider this example. Here, the second script (using the @ operator) takes 1.75x as long to execute...almost double the time of the first script.

So while yes, there is some overhead, per iteration, we see that the @ operator added only .005 ms per call. Not reason enough, imho, to avoid using the @ operator.

<?php
function x() { }
for (
$i = 0; $i < 1000000; $i++) { x(); }
?>

real 0m7.617s
user 0m6.788s
sys 0m0.792s

vs

<?php
function x() { }
for (
$i = 0; $i < 1000000; $i++) { @x(); }
?>

real 0m13.333s
user 0m12.437s
sys 0m0.836s

<< Back to user notes page

To Top