On Wed, 2008-08-06 at 23:41 +0200, Dirk Meyer wrote:
> The grid is a special case where it would not matter if the images are
> loaded by a thread and they pop up after each other. But in normal
> operation I want to see an image _now_.

At least for the actual UI (menus and such), any such images can be
preloaded, at startup or something, since we'll know what images are in
use based on the theme.


> Isn't texture_new_from_pixbuf a clutter 0.6 feature dropped in 0.8?

Oh, indeed it is.  I wonder why they did that.  I suppose it isn't
strictly needed, but it's a nice convenience.


> I will try to replace the imlib2 code with pixbuf and we will see. But
> it is late now, I will do this tomorrow.

Don't bother.  I ran the test and imlib2 is faster, but only by a slim
margin (like 7%).  See attached benchmark.


> But this is only a stupid performance test, loading 320 images at once
> and creating 1300 candy _and_ clutter objects isn't daily use. I just
> wanted to test if kaa.candy scales to avoid the problems we had with
> kaa.canvas and the tv guide grid taking too much time.

It's nice to know these sorts of performance characteristics, yeah.  So
what do you think, will the tv guide be a problem?

import gtk, clutter
import kaa, kaa.imlib2
import time, os, glob

files = glob.glob(os.path.expanduser('~/.thumbnails/large/*'))[:500]

print 'Warming cache ...'
[ file(f).read() for f in files ]

t0 = time.time()
for f in files:
    tex = clutter.Texture()
    img = kaa.imlib2.open(f)
    tex.set_from_rgb_data(img.get_raw_data(), True, img.width, img.height, 
                          1, 4, clutter.TEXTURE_RGB_FLAG_BGR)
dur = time.time() - t0
print "imlib2 method took %f (%f each)" % (dur, dur / len(files))

t0 = time.time()
for f in files:
    tex = clutter.Texture()
    pb = gtk.gdk.pixbuf_new_from_file(f)
    tex.set_from_rgb_data(pb.get_pixels(), True, pb.get_width(), pb.get_height(), 1, 4, 0)
dur = time.time() - t0
print "gdkpixbuf method took %f (%f each)" % (dur, dur / len(files))

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to