beta it republik » Features

Features

Untitled Document
Tuesday, 10 June 2008 | Feature

Time to Speed Up Your PHP Arrays

On his blog lately, Etienne Kneuss posted about a new part of the SPL (Standard PHP Library) that creates arrays up to 30 percent faster than standard PHP arrays, called SplFastArray. He explains that the speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size (which means no hashing and continuous memory storage).

He illustrates the working of this SplFastArray with a quick example, which shows the setting of the size for the array (and changing it) with a var_dump of the output result. He also adds that the speedup may vary from system to system, but the SplFastArray would be anywhere between 10-30 percent faster than standard PHP arrays.



Comment
Name:
Comment:

Captcha Verification !
captcha_image