performance problem

6 views
Skip to first unread message

Marco

unread,
Nov 3, 2010, 7:52:47 PM11/3/10
to pymt-dev
hi,

we just started to develop pymt apps and run into a performance
problem.
We use PyMT 0.5.1 on windows7.
On a Multitouch notebook with iCore5 we get 5fps,
and on iCore7 we get 50fps

- It makes no difference if we set in the config file
fbo = software | hardware | force-hardware.
- If we start the app we see "No OpenGL-accelerate module loaded".
Could that be the cause for the performance problem?
- With python profiler we discovered, that drawLabel() is really cpu
intensive.

Is this used to be normal or are we seeing some unexpected slow down?

Best,
Marco

Mathieu Virbel

unread,
Nov 3, 2010, 7:55:38 PM11/3/10
to pymt...@googlegroups.com
Hi Marco,

What application are you running ?

2010/11/3 Marco <marc...@googlemail.com>:

> --
> You received this message because you are subscribed to the Google Groups "pymt-dev" group.
> To post to this group, send email to pymt...@googlegroups.com.
> To unsubscribe from this group, send email to pymt-dev+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pymt-dev?hl=en.
>
>

marco kuhn

unread,
Nov 4, 2010, 7:34:45 AM11/4/10
to pymt...@googlegroups.com
Hi Mathieu,

we get this performance problem with our app.
But the ui_klist.py example have the same behaviour.
I get 30 fps with that example on a Mac Book Pro 2.6 GHz core 2 duo on Snow Leopard.
Is that normal?

Thanks,
Marco

2010/11/4 Mathieu Virbel <mat...@pymt.eu>



--
->homepage: http://www.hi-pi.de
-> PlayBox/PlayLive : http://www.hi-pi.de/play
->blog:http://www.hi-pi.de/blog
->myspace:http://www.myspace.com/hipiexperiment

Mathieu Virbel

unread,
Nov 4, 2010, 10:35:16 AM11/4/10
to pymt...@googlegroups.com
Not at all, without vsync, we have on some application more than 1000 FPS.
The desktop multiuser run at ~760FPS here.

Ensure you have updated your graphics card drivers. Otherwise, i have
absolutly no clue.
Are you running on windows ?

2010/11/4 marco kuhn <marc...@googlemail.com>:

Mathieu Virbel

unread,
Nov 4, 2010, 10:35:41 AM11/4/10
to pymt...@googlegroups.com
Ok, forget about win7 question :)

2010/11/4 Mathieu Virbel <mat...@pymt.eu>:

Matthias Georgi

unread,
Nov 4, 2010, 9:29:45 AM11/4/10
to pymt-dev
Hi,

I am a fellow of Marco.

We also gathered some profiling stats about out app and identified two
bottlenecks:
- drawLabel
- drawCSSRectangle

Both functions do a lot of stuff in background, like setting the css
styles,
so we are not sure, if opengl or the python stuff is the problem.
According to the log there is some problem with loading
opengl_accelerate,
but some lines below it appears that opengl was loaded correctly.

Especially a large amount of buttons is bad for performance.
Marco already stated, that the ui_klist.py example shows the same
behaviour.
Another possible bottleneck was the function set_color, which is
called a lot
during rendering.

Cheers
Matthias

On 4 Nov., 12:34, marco kuhn <marcis...@googlemail.com> wrote:
> Hi Mathieu,
>
> we get this performance problem with our app.
> But the ui_klist.py example have the same behaviour.
> I get 30 fps with that example on a Mac Book Pro 2.6 GHz core 2 duo on Snow
> Leopard.
> Is that normal?
>
> Thanks,
> Marco
>
> 2010/11/4 Mathieu Virbel <math...@pymt.eu>
>
>
>
>
>
>
>
>
>
> > Hi Marco,
>
> > What application are you running ?
>
> > 2010/11/3 Marco <marcis...@googlemail.com>:
> > > hi,
>
> > > we just started to develop pymt apps and run into a performance
> > > problem.
> > > We use PyMT 0.5.1 on windows7.
> > > On a Multitouch notebook with iCore5 we get 5fps,
> > > and on iCore7 we get 50fps
>
> > > - It makes no difference if we set in the config file
> > > fbo = software | hardware | force-hardware.
> > > - If we start the app we see "No OpenGL-accelerate module loaded".
> > >  Could that be the cause for the performance problem?
> > > - With python profiler we discovered, that drawLabel() is really cpu
> > > intensive.
>
> > > Is this used to be normal or are we seeing some unexpected slow down?
>
> > > Best,
> > > Marco
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "pymt-dev" group.
> > > To post to this group, send email to pymt...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > pymt-dev+u...@googlegroups.com<pymt-dev%2Bunsubscribe@googlegroups.c om>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/pymt-dev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pymt-dev" group.
> > To post to this group, send email to pymt...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > pymt-dev+u...@googlegroups.com<pymt-dev%2Bunsubscribe@googlegroups.c om>
> > .

Mathieu Virbel

unread,
Nov 4, 2010, 10:38:04 AM11/4/10
to pymt...@googlegroups.com
We know all of that, and the next generation is a complete change. We
are doing actually direct rendering, and we are moving totally on
shader. For the moment, even if we have heavilly optimized this
version, we can't do more on that, cause of the way of drawing.

2010/11/4 Matthias Georgi <matti....@gmail.com>:

> To unsubscribe from this group, send email to pymt-dev+u...@googlegroups.com.

Mathieu Virbel

unread,
Nov 4, 2010, 10:39:47 AM11/4/10
to pymt...@googlegroups.com
Can you change in your config log_level = debug, and send us the log
of any application ?
Of, start python -m pymt.tools.dump, say yes for sending to the paste,
and give us the link

2010/11/4 Mathieu Virbel <mat...@pymt.eu>:

Matthias Georgi

unread,
Nov 4, 2010, 10:41:03 AM11/4/10
to pymt-dev
well, it looks like opengl is running without hardware acceleration,
right?

do you know anything about this opengl_accelerate module missing log
message?

On 4 Nov., 15:35, Mathieu Virbel <math...@pymt.eu> wrote:
> Not at all, without vsync, we have on some application more than 1000 FPS.
> The desktop multiuser run at ~760FPS here.
>
> Ensure you have updated your graphics card drivers. Otherwise, i have
> absolutly no clue.
> Are you running on windows ?
>
> 2010/11/4 marco kuhn <marcis...@googlemail.com>:
>
>
>
>
>
>
>
> > Hi Mathieu,
>
> > we get this performance problem with our app.
> > But the ui_klist.py example have the same behaviour.
> > I get 30 fps with that example on a Mac Book Pro 2.6 GHz core 2 duo on Snow
> > Leopard.
> > Is that normal?
>
> > Thanks,
> > Marco
>
> > 2010/11/4 Mathieu Virbel <math...@pymt.eu>
>
> >> Hi Marco,
>
> >> What application are you running ?
>
> >> 2010/11/3 Marco <marcis...@googlemail.com>:

Mathieu Virbel

unread,
Nov 4, 2010, 10:43:07 AM11/4/10
to pymt...@googlegroups.com
No, opengl_accelerate is an python extension for pyopengl to prevent a
little bit python overhead in some case. Usually, you can ~10% of
performance.

2010/11/4 Matthias Georgi <matti....@gmail.com>:

Christopher Denter

unread,
Nov 4, 2010, 2:43:19 PM11/4/10
to pymt...@googlegroups.com
Hello,

we are aware of that and the next PyMT version will get a total rewrite
of all of this, highly optimized and with speed in mind.

However, why you're seeing THAT kind of bad performance I'm not too sure
about. What are your exact graphics cards/chips, what are your drivers
(make perfectly sure they installed properly).
And, most importantly, what is your app doing? Can you share some code?

You can ignore the OpenGL_accelerate warning.


Christopher

Matthias Georgi

unread,
Nov 4, 2010, 3:27:04 PM11/4/10
to pymt-dev
Thanks for all the kind answers so far.
Btw, we are totally amazed about pymt features and its well designed
api!

Our app is a remote control for ableton live, consisting of following
widgets:

- customized 8x8 button matrix, which renders additional labels
- 8 track mixers, with 4 buttons and 2 sliders for each track
- a couple additional buttons and sliders

My hardware and setup:

- Intel i5, 1.2 Ghz
- ATI Mobility Radeon HD5450
- Windows 7 64 bit
- ATI Driver Version 8.722

Im now going to install the newest catalyst drivers, as the driver
version seems to be old.

Cheers Matthias

On Nov 4, 7:43 pm, Christopher Denter <den...@the-space-station.com>
wrote:
> > > > pymt-dev+u...@googlegroups.com<pymt-dev%2Bunsubscr...@googlegroups.c om>
> > > > .
> > > > > For more options, visit this group at
> > > >http://groups.google.com/group/pymt-dev?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google Groups
> > > > "pymt-dev" group.
> > > > To post to this group, send email to pymt...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > pymt-dev+u...@googlegroups.com<pymt-dev%2Bunsubscr...@googlegroups.c om>

Matthias Georgi

unread,
Nov 4, 2010, 3:42:28 PM11/4/10
to pymt-dev
After updating the ATI drivers performance doubled from 6 fps to 14
fps!

My pymt debug log is as following:

[INFO ] PyMT v0.5.1
[INFO ] [Core ] Using accelerate module
[INFO ] [No OpenGL_accelerate module loaded] %s
[INFO ] [Unable to load registered array format handler
%s]
%s
[INFO ] [Graphx ] Using accelerate graphx module
[DEBUG ] [Cache ] register <pymt.label> with limit=1000,
timeout=1.0s
[DEBUG ] [Cache ] register <pymt.cssrect> with
limit=100, timeout=60s
[DEBUG ] [Audio ] register SoundPygame
[INFO ] [Camera ] using <gstreamer> as camera provider
[INFO ] [Text ] using <pygame> as text provider
[INFO ] [Video ] using <gstreamer> as video provider
[DEBUG ] [Cache ] register <pymt.svg> with limit=50,
timeout=Nones
[WARNING ] [Spelling] Unable to use <enchant> as
spellingprovider
[DEBUG ]
[CRITICAL ] [Spelling] Unable to find any valuable Spelling
providerat all!
[INFO ] [OSC ] using <thread> for socket
[DEBUG ] [Cache ] register <pymt.loader> with limit=500,
timeout=60s
[INFO ] [Loader ] using <pygame> as thread loader
[DEBUG ] [Cache ] register <pymt.css> with limit=500,
timeout=60s
[INFO ] [Window ] use Pygame as window provider.
[DEBUG ] [Core ] Creating PyMT Window
[DEBUG ] [WinPygame] Set window to fullscreen mode
[INFO ] [Window ] OpenGL version <3.2.9752 Compatibility
Profile Context>
[DEBUG ] [Fbo ] Forcing hardware Framebuffer
[DEBUG ] [Base ] Create provider from wm_touch
[INFO ] [Base ] Start application main loop

Matthias Georgi

unread,
Nov 4, 2010, 3:50:06 PM11/4/10
to pymt-dev
I forgot to mention, that the app without network layer is able to
render the ui with 25 fps.

Christopher Denter

unread,
Nov 4, 2010, 3:51:39 PM11/4/10
to pymt...@googlegroups.com
Very cool project, always wanted to see something like that!


Well, I got little experience with ATI, but the 'mobility' doesn't
really make me think it's a monster graphics card. However the FPS you
mentioned still seem slow.

Drivers is a good bet probably.

Otherwise feel free to report back.

Christopher

Christopher Denter

unread,
Nov 4, 2010, 3:59:46 PM11/4/10
to pymt...@googlegroups.com
Oh?

Maybe you have a problem in your design. So you're waiting for network
packets or something like that all the time? That would explain quite a
lot...

Christopher

Matthias Georgi

unread,
Nov 5, 2010, 4:06:53 AM11/5/10
to pymt-dev
OSCServer runs in threaded mode. We are getting a lot of messages, so
if
python spawns a thread for each message, I could imagine this kind of
overhead.

On Nov 4, 8:59 pm, Christopher Denter <den...@the-space-station.com>

Mathieu Virbel

unread,
Nov 5, 2010, 9:08:24 AM11/5/10
to pymt...@googlegroups.com
"spawn a thread for each message" ?

You could use a collections.deque for getting message from the thread
into the queue
Then, use the getClock().schedule_interval for reading the queue (.pop())

2010/11/5 Matthias Georgi <matti....@gmail.com>:

> To unsubscribe from this group, send email to pymt-dev+u...@googlegroups.com.

Matthias Georgi

unread,
Nov 6, 2010, 1:55:02 PM11/6/10
to pymt-dev
Thanks for the tip!

I looked into the OSC code and indeed, one thread per message.
Nonthreaded version also runs in its own thread, so this is quite ok.
Switching to nonthreaded doubled the performance!

Running the app with about 20 sliders on my i5 notebook gives me about
20 fps. Still not optimal, regarding, that you could launch a whole 3d
game with that performance, but much better than the first version.

On 5 Nov., 14:08, Mathieu Virbel <math...@pymt.eu> wrote:
> "spawn a thread for each message" ?
>
> You could use a collections.deque for getting message from the thread
> into the queue
> Then, use the getClock().schedule_interval for reading the queue (.pop())
>
> 2010/11/5 Matthias Georgi <matti.geo...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages