Welcome Guest, Not a member yet? Register   Sign In
supressing errors is really slow
#7

[eluser]xwero[/eluser]
Benchmarks on the error_reporting solution
Code:
$end = 1000;
        $this->benchmark->mark('dog');
        for($i=0;$i<$end;$i++)
        {
            $value = @$_POST['test'];
        }
        $this->benchmark->mark('cat');
        for($i=0;$i<$end;$i++)
        {
            error_reporting(0);
            $value = $_POST['test'];
            error_reporting(E_ALL);
        }
        $this->benchmark->mark('bird');
        
        echo '@ time : '.$this->benchmark->elapsed_time('dog', 'cat').'<br>';
        echo 'error_reporting time: '.$this->benchmark->elapsed_time('cat', 'bird').'<br>';

1 time result
@ time : 0.0001
error_reporting time: 0.0000

10 times result
@ time : 0.0003
error_reporting time: 0.0003

100 times result
@ time : 0.0022
error_reporting time: 0.0027

1000 times result
@ time : 0.0222
error_reporting time: 0.0266

so that's even worse than suppressing errors.


Messages In This Thread
supressing errors is really slow - by El Forum - 04-18-2008, 03:43 AM
supressing errors is really slow - by El Forum - 04-18-2008, 04:14 AM
supressing errors is really slow - by El Forum - 04-18-2008, 04:28 AM
supressing errors is really slow - by El Forum - 04-18-2008, 04:47 AM
supressing errors is really slow - by El Forum - 04-18-2008, 06:18 AM
supressing errors is really slow - by El Forum - 04-18-2008, 06:23 AM
supressing errors is really slow - by El Forum - 04-18-2008, 06:32 AM
supressing errors is really slow - by El Forum - 04-18-2008, 06:38 AM
supressing errors is really slow - by El Forum - 04-18-2008, 07:23 AM
supressing errors is really slow - by El Forum - 04-18-2008, 07:31 AM
supressing errors is really slow - by El Forum - 04-21-2008, 09:43 AM
supressing errors is really slow - by El Forum - 04-21-2008, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB