note 73699 deleted from language.operators.comparison by danbrown

From: Date: Thu, 18 Jun 2009 14:05:36 +0000
Subject: note 73699 deleted from language.operators.comparison by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-157069@lists.php.net to get a copy of this message
Note Submitter: floppie at quadra-tec dot net ---- I also ran a benchmark of equals versus identical on my own server. I found the difference to be surprisingly significant (average of 15% across multiple executions of the script). Just for kicks I had it compare int to float speed as well and that came up to roughly 40% faster in favor of int (in equal/identical comparisons - no idea how they perform otherwise), and had it compare ==/=== to !=/!== and came up to negligible difference (averages out to 0). Here are the results over 100k iterations - if you want to know exactly what comparisons were done let me know: 100000 iterations total identical 36.142370939255 total equals 41.991316795349 total is 38.998074293137 total not 39.135613441467 total int 29.253834247589 total float 48.879853487015 %gain identical vs equals 13.928941272788 %gain is vs not 0.35144242350103 %gain int vs float 40.151550872875 total time 78.15989112854

« previous php.notes (#157069) next »