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

[eluser]xwero[/eluser]
I've did a quick and dirty benchmark
Code:
$end = 10;
$this->benchmark->mark('dog');
for($i=0;$i<$end;$i++)
{
  $value = @$_POST['test'];
}
$this->benchmark->mark('cat');
for($i=0;$i<$end;$i++)
{
  $value = (isset($_POST['test']))?$_POST['test']:'';
}
$this->benchmark->mark('bird');
        
echo '@ time : '.$this->benchmark->elapsed_time('dog', 'cat').'<br>';
echo 'if time: '.$this->benchmark->elapsed_time('cat', 'bird').'<br>';

1 time result
@ time : 0.0001
if time: 0.0000

10 times result
@ time : 0.0003
if time: 0.0000

100 times result
@ time : 0.0023
if time: 0.0001

1000 times result
@ time : 0.0226
if time: 0.0014

There is quite some suppressing in CI's code so i start to wonder is it really necessary or is there alternative, faster code?


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