News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Davey's Blog:
Interesting memory use with GD images
May 21, 2007 @ 15:40:59

Richard Davey takes a look at some of the resource levels used for creating an image with GD in his latest blog entry:

While working on a project I noticed some interesting issues regarding GD images and the amount of memory they take up simply down to where you store them in your PHP script. If you are working with GD a lot then reading this short entry might save you some time / RAM! Update: I've also discovered something very interesting relating to autoloading classes, which again is related to memory allocation.

He was setting up to make a thumbnail from an image and thought to check some benchmarks on memory usage after three different methods:

  • normal, procedural code
  • putting the image resource into an object array
  • storing the image resource in an object variable
In the end, the results were pretty much expected - the procedural (object free) method came in lowest, while the other object-related options had more overhead. It was interesting (as he mentions too) to see the jump between procedural and the object options.

0 comments voice your opinion now!
gd memory usage image benchmark procedural object resource gd memory usage image benchmark procedural object resource


blog comments powered by Disqus

Similar Posts

Gopal Vijayaraghavan's Blog: APC 3.1.2 Released!

Paul Jones' Blog: When Possible, Use File *Resources* Instead Of File *Names*

Kore Nordmann's Blog: Comparision of PHP image libraries

PHPBuilder.com: Using PHP for the Creation of SVG Images

MaltBlue.com: How To Build an Extendible Zend Framework Application


Community Events





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


framework bugfix language introduction release conference library zendserver list podcast voicesoftheelephpant tips symfony deployment developer interview community laravel api series

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