Re: how efficient is the canvas
- From: Erik Andersen <andersen xmission com>
- To: John R Sheets <dusk ravendusk org>
- Cc: Lauris Kaplinski <lauris ariman ee>, Federico Mena Quintero <federico nuclecu unam mx>, gnome-devel-list gnome org
- Subject: Re: how efficient is the canvas
- Date: Thu, 5 Aug 1999 09:55:26 -0600
On Thu, Aug 05, 1999 at 09:08:29AM -0500, John R Sheets wrote:
> > On Wed, 4 Aug 1999, Lauris Kaplinski wrote:
> >
> > But it creates separate pixmaps & masks, which make it still unefficient
> > for bunches of identical images.
>
> Thanks, Lauris, that's what I was referring to. In my small test
> case, it takes 3-6 seconds to render 36 small icon-sized tiles.
> A decent sized map will take 10-20 and more seconds to render,
> which is a bit harder to swallow. Note, the delay is not during
> canvas item creation, but when it first tries to show the canvas.
>
> Of course, there might be a better way of doing what I'm doing.
> As far as I know, I'm keeping it simple and straightforward. I
> only create one GdkImlibImage per image.
>
> John
>
Hmm. GnomeHack uses the gnome canvas to create its map out of
_lots_ of little images (3360 images at a time to be exact). These
images are tiled onto the canvas, and then a window which displays
a subset of the whole map is displayed. On my computer (a 433Mhz
Celeron) it takes less than a second to render all of these 3360
images and display them in the canvas.
Gnomehack used to take a _really_ long time to render also. Then
we fixed our code. Based on the fact that GnomeHack can display all
these tiles in a gnome canvas in well under a second, I think that
your code could also use some improvement if it takes 6 seconds for
only 36 small images. Please feel free to check out how GnomeHack
does things.
http://www.xmission.com/~andersen/erik/gnomehack/gnomehack.html
in particular, the gnome-canvas stuff live in:
http://cvs.gnome.org/lxr/source/nethack/win/gnome/GnomeHackMapWindow.c
-Erik
--
Erik B. Andersen Web: http://www.xmission.com/~andersen/
email: andersee@debian.org
--This message was written using 73% post-consumer electrons--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]