More on thumbnailing and optimization
Following my last post, spent most of the of the time on different imaging libraries to find a faster way of doing thumbnails and optimization.
I tested the following libraries to create image thumbnails, GdkPixbuf, imlib2, ImageMagic, epeg. Pixbuf gives somewhat nice timings , imlib2 is fast but was leaking too much memory. ImageMagic seems to the slowest among them. Last try was with epeg which can only handle jpegs and it came out as the fastest. So wrote a C function and using it from inside vala code using extern.
Next target was to find better way to get thumbnails from RAW images, tried libopenraw and LibRaw for that. But with help from yorba developers found the way to do it using gexiv2 only.
In between tried few tools for profiling the application, sayamindu told me about sysprof which seems to be the easiest for my purpose. Using it I found gexiv2_metadata_open_path is taking around 67% of time, inside it Exiv2::TiffImage:readMetaData is taking 51% of time.
Now coming to the point of speed , 1st run is on 1GB of RAW files
real 0m2.946s user 0m2.542s sys 0m0.116s
2nd run is on same 36GB of images , among them around half is RAW.
real 4m0.807s user 0m54.283s sys 1m24.789s
Now this is fast in my textbook :D I should not forget to tell about the great help I got from #vala and Adrien Bustany in the whole work.
4 Comments to More on thumbnailing and optimization
The reason epeg is fast is because it uses nearest neighbour scaling, which produces aweful results. See e.g.
http://mail.gnome.org/archives/gtk-devel-list/2009-September/msg00102.html
July 9, 2010
[...] This post was mentioned on Twitter by Planet Fedora. Planet Fedora said: Kushal Das: More on thumbnailing and optimization: Following my last post, spent most of the of the time on differ… http://bit.ly/c81ikU [...]
July 9, 2010
Thanks for this info, I will compare the thumbnails again tomorrow , certainly Pixbuf did a great job when I tried.
Kushal,
Can you explain why sys time is more than user time for processing 36 GB of images with most of them being RAW images? May be I am missing something very very fundamental here?
–
A
July 9, 2010