Re: Better way to store data in memory?
| From: | Nicolas Quirin | Date: | Mon, 23 Jul 2007 18:00:31 +0000 |
| Subject: | Re: Better way to store data in memory? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259386@lists.php.net to get a copy of this message | ||
Perhaps, you can use Zend Cache which comes with Zend Framework to store your data, without sharing them, allowing to store them in files or memory (shared or not)
in an easy way...I'm intersting on Zend cache for its roadmap and because its a Zend product, like php...best quality and best support.
I'm using it to cache various php objects, build the first time from database query...later from cache...really good...
----- Original Message ----- From: "Richard Davey" <rich@corephp.co.uk>
To: <php-general@lists.php.net>
Sent: Monday, July 23, 2007 6:50 PM
Subject: [PHP] Better way to store data in memory?
Hi php-general collective, I'm building up some image data in my PHP script (ready for output to the browser). Having to do some complex per pixel manipulation, which is fine - but I'm just wondering is there a quicker / more efficient way of storing the pixel data than in an array? At the moment I hold it in $array[$x][$y], which makes the drawing loop painless, but it's creating an array with 307,200 elements which is proving to be quite slow. As I'm only storing fixed width byte values is there an alternative method? For example the ability to read/write to a chunk of memory instead? (so I can read out whole strips of data rather than one by one?) I was looking at the Shared Memory functions, but that isn't exactly what I need (I don't want it shared, I want it process specific) Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php