Looked at cachegrind output and image_get_info was taking a lot of time; called from theme_imagecache. My files dir is a S3 mount thus its a little bit slower. I did some local testing and if the file is local a cache_get is slower. But if the file is not local then cache_get is way faster.
http://drupal.org/node/1017820
I've attached a simple module that works; anyone find this useful? It works by overriding theme_imagecache.
This will make your site slower unless your files directory is not local. If its not local & cachegrind ID's this function as taking time then this might speed your site up. Your mileage may vary.
Is this a one-off or should I commit it to drupal's CVS as others have encountered this same issue?

Comments
if the file is local a
Wow, really? image_get_info() calls getimagesize() and filesize() - so it has to go to the disk and deal with file handlers twice, and parse the data once (presumably getimagesize() is able to determine the image's dimensions without actually decompressing it into a bitmap first… at least, I hope so). Hence why I try to code around image_get_info() on image-heavy sites and cache the data instead. But if you've tested it and found that cache_get() is actually slower for local files… excuse me for a minute while my world turns on end. :P
Anyway, I'll keep that in mind for the future… It will make life easier.
The Boise Drupal Guy!
My method was flawed.
Now that I think about it, we hacked core and put caching at the APC level directly in that function; APC being local will almost always be faster. Problem with APC is we run on a cluster with 7 boxes so dumping it in memcache is smart. Thus my testing was flawed & now that I think about disk access times, I can say with 100% certainty that it was.
So in this case caching, image_get_info via the theme_imagecache trick should be a big win. Guess I'll release the code as a formal module tomorrow. Thanks for the input!
Created the module
http://drupal.org/project/imageinfo_cache
Updated code = module that rocks!
Imageinfo Cache will now auto generate all imagecache presets right after you upload a file & do it asynchronously. It also caches theme_imagefield_image as this was taking some time on node save.
cool, but what if the files
cool,
but what if the files are being pushed to a CDN using something like a media module.
will it still create the presets ?
I am still new to the possibilities of using CDN as iv heard its well supported in D7
rajarju
Presets
I use imagecache_generate_image to generate the presets. I've never used the media module but if it works with imagecache, it should work with this setup. So this requires the dev version of imagecache.
alright.. ill try it out with
alright.. ill try it out with media mover .. and post my views
rajarju