3 ms·
Awesome, but I still don't think it's enough. In benchmarks we did the memory usage of PHP array() was horrific. Sorry I don't have actual numbers to post, but
by mmaunder 12y ago
Awesome, but I still don't think it's enough. In benchmarks we did the memory usage of PHP array() was horrific. Sorry I don't have actual numbers to post, but we ended up using pack() and unpack() to store stuff that should have been in an array because it would grow to 100's of megs using PHP's array() and using a binary structure it stays under 10 megs. I just don't think a 2.5X improvement is going to come close to as efficient as it could and should be.
- porker 12y ago> we ended up using pack() and unpack() to store stuff that should have been in an array because it would grow to 100's of megs using PHP's array() and using a binary structure it stays under 10 megs. How many items were you storing / how big was the data in each item?
- porker 12y agoTo whoever downvoted this comment, please say why.
- halflings 12y agoCheck the part about packed hashtables (in case you're not storing key/value pairs). They said they're considering a more compact type for actual arrays.
- mootothemax 12y agowe ended up using pack() and unpack() to store stuff Out of interest, can you give a few more details of what you were storing, and how? I've seen serialise() used surprisingly often (WordPress comes to mind!), which is always going to be pretty verbose: http://uk.php.net/serialize http://uk.php.net/serialize
- gburt 12y agoThis is my experience benchmarking the same as well. That, combined with a bug in SPLFixedArray that results in it acting like a non-fixed array past some size, makes it very difficult to consider PHP for anything that requires high performance on tight loops/data crunching. To the extent that it is often viable to run another programming language's implementation of your code operating as a service for your PHP code.