News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Etienne Kneuss' Blog:
SplFastArray to speed up your PHP arrays
June 09, 2008 @ 12:54:04

Etienne Kneuss has posted about a new part of the Standard PHP Library that creates arrays that are up to thirty percent faster than normal methods - SplFastArray.

Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it's indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size.

The code sample shows the setting of the size for the array (and changing it) with a var_dump of the output result. This method is always faster than normal arrays, it just varies how much from system to system (anywhere from ten to thirty percent).

0 comments voice your opinion now!
spl splfastarray set size speed faster



Similar Posts

Matthew Turland's Blog: Environmental Awareness Quickie

LotsOfCode.com: Tag Cloud Tutorial

Ilia Alshanetsky's Blog: PHP 5.2.0 RC1 Released!

DevShed: Overloading Classes in PHP 5

Sebastian Bergmann's Blog: PHP / GCC / ICC Benchmark


Community Events











Don't see your event here?
Let us know!


cakephp database package mysql security framework release book ajax example releases zendframework code zend application job PEAR PHP5 developer conference

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework