Discussion:
gtk.main_iteration is slow
Stuart Axon
2009-04-15 14:36:58 UTC
Permalink
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.

I rendered 100 frames of my bot and got these results:

Time per frame

0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration

I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?


S++
ricardo lafuente
2009-04-16 15:49:39 UTC
Permalink
Post by Stuart Axon
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.

i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
Dave Crossland
2009-04-16 16:22:45 UTC
Permalink
Qt could give us better mac support, so yes :)

Regards, Dave

On 16 Apr 2009, 4:49 PM, "ricardo lafuente" <***@sollec.org> wrote:

Stuart Axon wrote: > > I've been playing around with shoebot trying to find
out some info on perform...
yes, that was the easiest way to get animation working. I remember seeing it
work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder how
much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.

i've been working with Qt recently (which Nodebox also uses for their *nix
port) and read some benchmarks some time ago that place their renderer
orders of magnitude faster than Cairo... this would require quite some
effort to switch from GTK, but i would be happy to have just a Qt window
showing the canvas (i.e. no shoebot-ide porting). Should we consider this?

_______________________________________________ Shoebot-devel mailing list
Shoebot-devel-***@public.gmane.org
ricardo lafuente
2009-04-22 21:52:21 UTC
Permalink
Post by Dave Crossland
Qt could give us better mac support, so yes :)
Totally -- i got a bit disappointed with the difficulty involved in
getting GTK apps to work on a Mac; either you install X11 from the OSX
cd, or you can use the Imendio package of GTK for OSX, which still lacks
features we need. Both ways are a bit tough to get Mac users to go
through, so it looks like we'll need an alternative engine if we want to
see Shoebot on the Mac.

On the plus side, i'm now working actively with Qt for some commercial
projects and learning a lot in the process; the effort in making a Qt
backend is not so huge given that we can turn to Nodebox's Qt port for
reference. Anyone up for it in the near future?

:r
Post by Dave Crossland
Stuart Axon wrote: > > I've been playing around with shoebot trying to find
out some info on perform...
yes, that was the easiest way to get animation working. I remember seeing it
work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder how
much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their *nix
port) and read some benchmarks some time ago that place their renderer
orders of magnitude faster than Cairo... this would require quite some
effort to switch from GTK, but i would be happy to have just a Qt window
showing the canvas (i.e. no shoebot-ide porting). Should we consider this?
_______________________________________________ Shoebot-devel mailing list
------------------------------------------------------------------------
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Stuart Axon
2009-04-23 12:50:37 UTC
Permalink
Hm, I notice the newest download from gtk-osx.org is 2.14.x... do you know which parts are missing - it may be worth leaving bug reports.



----- Original Message ----
From: ricardo lafuente <***@sollec.org>
To: shoebot-devel-***@public.gmane.org
Sent: Wednesday, April 22, 2009 10:52:21 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow
Post by Dave Crossland
Qt could give us better mac support, so yes :)
Totally -- i got a bit disappointed with the difficulty involved in getting GTK apps to work on a Mac; either you install X11 from the OSX cd, or you can use the Imendio package of GTK for OSX, which still lacks features we need. Both ways are a bit tough to get Mac users to go through, so it looks like we'll need an alternative engine if we want to see Shoebot on the Mac.

On the plus side, i'm now working actively with Qt for some commercial projects and learning a lot in the process; the effort in making a Qt backend is not so huge given that we can turn to Nodebox's Qt port for reference. Anyone up for it in the near future?

:r
Post by Dave Crossland
Stuart Axon wrote: > > I've been playing around with shoebot trying to find
out some info on perform...
yes, that was the easiest way to get animation working. I remember seeing it
work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder how
much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their *nix
port) and read some benchmarks some time ago that place their renderer
orders of magnitude faster than Cairo... this would require quite some
effort to switch from GTK, but i would be happy to have just a Qt window
showing the canvas (i.e. no shoebot-ide porting). Should we consider this?
_______________________________________________ Shoebot-devel mailing list
------------------------------------------------------------------------
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
francesco fantoni
2009-04-16 16:47:59 UTC
Permalink
I think it would be more interesting trying to optimize the code and get
faster with cairo, switching to Qt would mean quite a huge effort, and
cairo has some advantages (thinking about pango or pdf export e.g.).
Besides there's already nodebox port working on qt, so having a
different approach could be interesting for catching a different users
base.

Maybe we could get some python-cairo developer involved...
Post by ricardo lafuente
Post by Stuart Axon
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
--
architetto Francesco Fantoni
<HVA - Hermanitos Verdes Architetti>
l.go san giacomo, 38
I-41100 modena (italia)
tel.& fax. +39.059.217554
skype: hva_studio
e.mail: francesco-***@public.gmane.org
web: http://www.hv-a.com
Stuart Axon
2009-04-16 16:58:32 UTC
Permalink
I'm thinking along the same lines, other advantages include the
inkscape plugin.
I've been playing with pure python + cairo + pygtk recently,
so will see if I can come up with a simple test case to push to
pygtk (and possibly gtk).
I'm really not sure how hard it is to get QT + python working
in windows either.

Certainly of interest is this page
http://cairographics.org/OpenGL/
on using cairo with opengl.

If QT is considered, I think we should keep the cairo backend
and look at having seperate backends (I guess we would need
some sort of test suite to make sure the output is consistent.

On the subject of a test suite, this is something we might want
to share with nodebox too).





----- Original Message ----
From: francesco fantoni <francesco-pB81QDORtWSUBmjqxMAjcGD2FQJk+8+***@public.gmane.org>
To: shoebot-devel-***@public.gmane.org
Sent: Thursday, April 16, 2009 5:47:59 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow

I think it would be more interesting trying to optimize the code and get
faster with cairo, switching to Qt would mean quite a huge effort, and
cairo has some advantages (thinking about pango or pdf export e.g.).
Besides there's already nodebox port working on qt, so having a
different approach could be interesting for catching a different users
base.

Maybe we could get some python-cairo developer involved...
Post by ricardo lafuente
Post by Stuart Axon
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
--
architetto Francesco Fantoni
<HVA - Hermanitos Verdes Architetti>
l.go san giacomo, 38
I-41100 modena (italia)
tel.& fax. +39.059.217554
skype: hva_studio
e.mail: francesco-***@public.gmane.org
web: http://www.hv-a.com
Stuart Axon
2009-04-21 23:42:49 UTC
Permalink
Some further research...

I managed to modify the code on this page
http://ethanmiller.name/notes/pyglet_pycairo/?disqus_reply=8543776#comment-8543776
(ignore the embaressing show me the codez style comments :)

to use opengl + cairo together... however it's not fully working as my opengl-fu is not up
to scratch.

If anyone knows a little opengl and could have a look that would be great (I couldn't get
pyglet and cairo to play nice with each other (I can't get the text to render AND the opengl)).


As far as it works the framerate appears really good.
If it works, we can probably want to switch to pygtkglext for the drawing... unfortunately I
couldn't seem to find a simple example with pygykglext + cairo (although I believe some
C ones exist). If anyone has some good opengl and/or python-fu I can probably point
to some examples as I don't yet have enough open gl experience to know what I'm
doing :)



----- Original Message ----
From: Stuart Axon <stuaxo2-/***@public.gmane.org>
To: shoebot-devel-***@public.gmane.org
Sent: Thursday, April 16, 2009 5:58:32 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow


I'm thinking along the same lines, other advantages include the
inkscape plugin.
I've been playing with pure python + cairo + pygtk recently,
so will see if I can come up with a simple test case to push to
pygtk (and possibly gtk).
I'm really not sure how hard it is to get QT + python working
in windows either.

Certainly of interest is this page
http://cairographics.org/OpenGL/
on using cairo with opengl.

If QT is considered, I think we should keep the cairo backend
and look at having seperate backends (I guess we would need
some sort of test suite to make sure the output is consistent.

On the subject of a test suite, this is something we might want
to share with nodebox too).





----- Original Message ----
From: francesco fantoni <francesco-pB81QDORtWSUBmjqxMAjcGD2FQJk+8+***@public.gmane.org>
To: shoebot-devel-***@public.gmane.org
Sent: Thursday, April 16, 2009 5:47:59 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow

I think it would be more interesting trying to optimize the code and get
faster with cairo, switching to Qt would mean quite a huge effort, and
cairo has some advantages (thinking about pango or pdf export e.g.).
Besides there's already nodebox port working on qt, so having a
different approach could be interesting for catching a different users
base.

Maybe we could get some python-cairo developer involved...
Post by ricardo lafuente
Post by Stuart Axon
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
--
architetto Francesco Fantoni
<HVA - Hermanitos Verdes Architetti>
l.go san giacomo, 38
I-41100 modena (italia)
tel.& fax. +39.059.217554
skype: hva_studio
e.mail: francesco-***@public.gmane.org
web: http://www.hv-a.com
ricardo lafuente
2009-04-22 21:46:29 UTC
Permalink
Post by Stuart Axon
I'm thinking along the same lines, other advantages include the
inkscape plugin.
true, good point.
Post by Stuart Axon
If QT is considered, I think we should keep the cairo backend
and look at having seperate backends (I guess we would need
some sort of test suite to make sure the output is consistent.
indeed, our current architecture already support having separate
backends, once we decide what we want to do. One would just need to
subclass Canvas and make the methods for handling the
drawables+transforms. This would still be a bit tough because Canvas is
a bit hacky in some parts, but i am totally up to sorting those issues
out for whoever wants to dip their feet in alternative backends and
frontends, that's the way to go from here.

your GL experiments sound really juicy, and i'd love to help if it
wasn't for my total ignorance of openGL; besides that, there's still
some details i need to iron out in the package and submit it properly to
the main spots (freshmeat et al). After that my intentions are to work
on the DrawBot frontend -- i would love to see the Dutch guys get on our
boat :)
Post by Stuart Axon
On the subject of a test suite, this is something we might want
to share with nodebox too).
they do have one, though i think it's a bit messy and confusing; anyway,
better than nothing! I'm writing this off-line so i can't check the
exact address, but look in the Nodebox source tree, there's a tests/ dir
somewhere.

:r
Post by Stuart Axon
----- Original Message ----
Sent: Thursday, April 16, 2009 5:47:59 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow
I think it would be more interesting trying to optimize the code and get
faster with cairo, switching to Qt would mean quite a huge effort, and
cairo has some advantages (thinking about pango or pdf export e.g.).
Besides there's already nodebox port working on qt, so having a
different approach could be interesting for catching a different users
base.
Maybe we could get some python-cairo developer involved...
Post by ricardo lafuente
Post by Stuart Axon
I've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Loading...