note 110612 added to class.splfixedarray
| From: | artaxerxes | Date: | Tue, 13 Nov 2012 04:41:13 +0000 |
| Subject: | note 110612 added to class.splfixedarray | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191907@lists.php.net to get a copy of this message | ||
As the documentation says, SplFixedArray is meant to be *faster* than array. Do not blindly believe
other people's benchmarks, and beextra careful with the user comments on php.net. For instance,
nairbv's benchmark code is completely wrong. Among other errors, it intends to increase the
size of the arrays, but always initialize a 20 elements SplFixedArray.
On a PHP 5.4 64 bits linux server, I found SplFixedArray to be always faster than array().
* small data (1,000):
* write: SplFixedArray is 15 % faster
* read: SplFixedArray is 5 % faster
* larger data (512,000):
* write: SplFixedArray is 33 % faster
* read: SplFixedArray is 10 % faster
----
Server IP: 195.221.21.36
Probable Submitter: 88.172.133.112
----
Manual Page -- http://www.php.net/manual/en/class.splfixedarray.php
Edit -- https://master.php.net/note/edit/110612
Del: integrated -- https://master.php.net/note/delete/110612/integrated
Del: useless -- https://master.php.net/note/delete/110612/useless
Del: bad code -- https://master.php.net/note/delete/110612/bad+code
Del: spam -- https://master.php.net/note/delete/110612/spam
Del: non-english -- https://master.php.net/note/delete/110612/non-english
Del: in docs -- https://master.php.net/note/delete/110612/in+docs
Del: other reasons-- https://master.php.net/note/delete/110612
Reject -- https://master.php.net/note/reject/110612
Search -- https://master.php.net/manage/user-notes.php