[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] Evas vs Gtk/Gdk: why the difference of perfs is so impor tant?

> Hi,
> I ran on my P3 1Ghz a small (stupid) test to compare Evas and Gdk
> performances: with Evas, I displayed a big image (1600x1200) in a
> smaller window (1300x1100) and I dragged the image quickly with
> the mouse. The dragging was laggy and the cpu usage was almost
> 100%. I then ran exactly the same test with gqview (a gtk image
> viewer) with the same image and the same viewport size (1300x1100).
> There, the dragging was smooth and the cpu usage around 50%.
> I know this test is not representative (it shows a special case
> with no accurate results) but it just illustrates the feeling
> I have: evas seems a lot slower than the renderers of Gtk and QT,
> when it has to refresh a big part of its viewport. Of course, 
> using the GL engine improves the perfs a lot, but the comparison
> doesn't make sense anymore: Evas is hardware-accelerated while
> Gtk is not.
> I'd just like to know why the difference is so important? Is Gtk
> somehow hardware-accelerated (xrender?), or is it because Evas
> and Gdk just do not do things the same way? I don't think the
> rendering routines of Evas are to blamed since they seem even more
> optimized than what other libs use, I just don't understand the
> difference of perfs.
> Can you tell me more about that?
> Regards,
> Simon TRENY <MoOm>

	I see that raster has already replied to this, but I thought
I'd give you my views on this matter :)

	First, I personally have no idea what Gtk/Gdk or Qt do for
rendering an immage to a window.. But, we might guess that the image
data is being put on a pixmap (via an intermediate ximage at first),
and then parts of that pixmap are being copied onto whatever part of
the window is being updated.

	If this is the case, then it should be very fast.

	You could write a prgram to do this in a couple of minutes
(use imlib2 or evas for the image loading if you like) -- there is
really no 'rendering' on your part that needs to be done.

	However, it's fairly limited to just that kind of thing,
plus maybe whatever else one can draw on xdrawables via xlib's
standard drawing functions.

	If you wanted to do something like have a fixed background
image and then foreground text and icons, and other images, and
whatnots, that are *alpha-blended* onto that background and which
themselves move/scroll (but the bg image does not), or some objects
scroll and others don't, or they are changing in some way - being
scaled, changing color, moving at different speeds, etc, etc...
then one needs more intermediate steps and more state to keep..

	Good luck writing a program that can do this, from scratch,
within a couple of months...

	Evas is designed with just this kind of generality in mind,
and allows you do all those things fairly easily.
	Try doing a similar test where there are more complex things
and alpha-blended objects are involved.. assuming there is some Gtk/
Qt program that will do so, I don't know (you could always try the
Gimp I guess).

	Unless a toolkit/lib were really flexible about being able
to change the way it's rendering, and somehow allowed one to choose,
it would be tough to have the ability to do both these kinds of
things within a retained-mode drawing context.