speed of wxPython application - why slower on OS X?

Hi,

we are writing an application that uses wxPython for the GUI
It works on linux , windows and OSX so far,
but the OSX version seems to be much slower than the other two.
Linux machine is AMD athlon XP2000 (1.6GHz) Fedora core 3 python 2.4
OS X machine is PowerMac G5 1.6GHz OSX 10.4 python2.4

Is this always the case for wxPython/Python, or are we running into a platform specific bug?

cheers

Dan

BTW, our application project page is at http://www.bioimagexd.org
and we are releasing the beta windows version on 9th Feb.

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

Dan White wrote:

but the OSX version seems to be much slower than the other two.

What, exactly is slower about it?

In general, I've found Python and wxPython to be reasonably snappy on OS-X, but there may be some things that are slower.

In particular, I've heard that STC is slow, and that's due to the DC Text calls. Are you using STC or a lot of text calls witha DC?

Also, OS-X double buffers everything, so if you're double buffering yourself, you could be inadvertently getting triple buffering. I haven't noticed a performance impact from this, but it's a possible issue.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

we are writing an application that uses wxPython for the GUI
It works on linux , windows and OSX so far,
but the OSX version seems to be much slower than the other two.
Linux machine is AMD athlon XP2000 (1.6GHz) Fedora core 3 python 2.4
OS X machine is PowerMac G5 1.6GHz OSX 10.4 python2.4

Slower how? Slower loading? Slower scrolling? Slower response?
Slower screen refresh? More flicker?

Is this always the case for wxPython/Python, or are we running into a
platform specific bug?

I haven't done any OSX development personally, but from what I
have observed in my personal use, OSX feels a bit sluggish during use.
Could just be me?

- Josiah

Hi Chris,

theis is a 3D rendering application, using openGL VTK c++ libraries,
wrapped with python,
with the view controlled by the wxPython GUI.

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

using shark, i think i see that much processor time is being used by openGL ,
with some symbol called _dyld_start eating well over half of the processor time.

still I dont know if it is python, wxMac or openGL that is causing the bottle neck, if there is one.

on windows and linux with the same code, the 3D rendering is much faster...

Dan

cheers

Dan White wrote:

but the OSX version seems to be much slower than the other two.

What, exactly is slower about it?

In general, I've found Python and wxPython to be reasonably snappy on OS-X, but there may be some things that are slower.

In particular, I've heard that STC is slow, and that's due to the DC Text calls. Are you using STC or a lot of text calls witha DC?

Also, OS-X double buffers everything, so if you're double buffering yourself, you could be inadvertently getting triple buffering. I haven't noticed a performance impact from this, but it's a possible issue.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

···

On Jan 31, 2006, at 7:59 PM, Christopher Barker wrote:

Hi Dan. I am a mac user and using wxPython for cross platform development. I am not sure what it is that may be causing the problem but I recently upgraded from Jaguar to Panther. I noticed that wxPython seemed slower with Panther after the upgrade. I was previously running the ANSI version which seemed faster. I am now running unicode version as I needed to upgrade my OS to get webkit support for wxPython. I don't know which factor may be to blame for any slowdown. Whether this OS or ANSI vs Unicode version?

My machine has only 256Mb of RAM. This amount of RAM is acceptable for most operations on my Machine except DV editing with Final Cut (although it would be nice to have more). Listcntrl behavior seems much slower than with previous Jaguar with ANSI setup it was fairly zippy. Some operations on my machine appear faster with Panther in general (like searching for files) but wxPython does have a slower feel to me than before I upgraded.

Regards,
David

Dan White wrote:

···

Hi Chris,

theis is a 3D rendering application, using openGL VTK c++ libraries,
wrapped with python,
with the view controlled by the wxPython GUI.

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

using shark, i think i see that much processor time is being used by openGL ,
with some symbol called _dyld_start eating well over half of the processor time.

still I dont know if it is python, wxMac or openGL that is causing the bottle neck, if there is one.

on windows and linux with the same code, the 3D rendering is much faster...

Dan

cheers

On Jan 31, 2006, at 7:59 PM, Christopher Barker wrote:

Dan White wrote:

but the OSX version seems to be much slower than the other two.

What, exactly is slower about it?

In general, I've found Python and wxPython to be reasonably snappy on OS-X, but there may be some things that are slower.

In particular, I've heard that STC is slow, and that's due to the DC Text calls. Are you using STC or a lot of text calls witha DC?

Also, OS-X double buffers everything, so if you're double buffering yourself, you could be inadvertently getting triple buffering. I haven't noticed a performance impact from this, but it's a possible issue.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer
                                           NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users- help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

[...]

still I dont know if it is python, wxMac or openGL that is causing
the bottle neck, if there is one.

on windows and linux with the same code, the 3D rendering is much
faster...

On the same hardware?

···

On 2006-01-31, Dan White <dan@chalkie.org.uk> wrote:

--
Grant Edwards grante Yow! does your DRESSING
                                  at ROOM have enough ASPARAGUS?
                               visi.com

Dan White wrote:

theis is a 3D rendering application, using openGL VTK c++ libraries,
wrapped with python,
with the view controlled by the wxPython GUI.

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

I'd say you've got a problem with VTK and/or OpenGL. I'd ask the VTK lists about it. maybe it's not using hardware acceleration?

We've been working recently on a VTK app with C++ wxWidgets, but I haven't had a chance to compare performance between OS-X and other platforms.

I'd love to see your app -- I'd like to use wxPython rather than wxC++ for some of our work, I'd love to see a sample. Your web site doesn't seem to be responding. Is your app open source?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Are you sure you turned vsync off? This would cause opengl to stall between swapping front and back buffer and slow down your application a lot. Also, how do you measure rendering speed? In fps or ms? If you measure in fps, then you should be aware that if the fps goes from 100 to 50 is not as bad as the fps going from 50 to 25.
I don't know VTK, but maybe the mac exposes different extensions to the user which can affect the rendering speed significantly.
Maybe it's also an issue how you wrote your main loop.
You should probably determine if you are fillrate or memory or vertex or ... bound. If it's fillrate and the processor time is high, then either you are not using hw acceleration (which I doubt) or you are doing something wrong like vsync switched off. You can test if you are fillrate limited quickly by making your rendering window smaller.

-Matthias

···

On Tue, 31 Jan 2006 20:12:42 +0100, Dan White <dan@chalkie.org.uk> wrote:

Hi Chris,

theis is a 3D rendering application, using openGL VTK c++ libraries,
wrapped with python,
with the view controlled by the wxPython GUI.

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

using shark, i think i see that much processor time is being used by openGL ,
with some symbol called _dyld_start eating well over half of the processor time.

still I dont know if it is python, wxMac or openGL that is causing the bottle neck, if there is one.

on windows and linux with the same code, the 3D rendering is much faster...

Dan

Hi Grant,

OSX machine is 1.6GHz G5 OSX 10.4.4 1.25Gb RAM GeForceFX5200 64Mb
linux is AMD athlon xp 2000 (1.6GHz) fedora core 3, 1.5 Gb RAM, NVidia Qaudro4 XGL 980 265MB
windows is an acer travelmate 8000 laptop, win XP, 1.8GHz Pentium M, 512 MB RAM, Radeon mobility 9700 128MB

python 2.4
VTK 5
wxPython 2.6

The data set I am looking at is quite small so it should easily all fit in RAM, and the textures should? fit in VRAM.

8 bit image, dimensions 172x152x33 pixels (not sure how to work out how much texture memoty on the VRAM that uses?)
VTK makes textures of the 33 images and renders them to display using 2D texture maps on the graphics card with openGL

But, maybe the 64 MB VRAM of the G5 is the bottle neck...?

Or does wxPython just run slower on OSX than linux and windows...?

cheers

Dan

Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

[...]

still I dont know if it is python, wxMac or openGL that is causing
the bottle neck, if there is one.

on windows and linux with the same code, the 3D rendering is much
faster...

On the same hardware?

--
Grant Edwards grante Yow! does your DRESSING
                                  at ROOM have enough ASPARAGUS?
                               visi.com

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

···

On Jan 31, 2006, at 9:45 PM, Grant Edwards wrote:

On 2006-01-31, Dan White <dan@chalkie.org.uk> wrote:

Hi Matthias

the frame rate is the same with a small or large window, so its not the fill rate.
I am jusr looking at the screen and seeing the frame rate visually, since it is about a 3 or 4 per second on the Mac,
and more than 10 on win and linux. Maybe we can put up a fps indicator in the render window....

We can sure look into the vsync on or off issue!

cheers

Dan

Are you sure you turned vsync off? This would cause opengl to stall between swapping front and back buffer and slow down your application a lot. Also, how do you measure rendering speed? In fps or ms? If you measure in fps, then you should be aware that if the fps goes from 100 to 50 is not as bad as the fps going from 50 to 25.
I don't know VTK, but maybe the mac exposes different extensions to the user which can affect the rendering speed significantly.
Maybe it's also an issue how you wrote your main loop.
You should probably determine if you are fillrate or memory or vertex or ... bound. If it's fillrate and the processor time is high, then either you are not using hw acceleration (which I doubt) or you are doing something wrong like vsync switched off. You can test if you are fillrate limited quickly by making your rendering window smaller.

-Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

Hi Chris,

the BioImageXD software will be available as a windows binary installer, and as source code on february the 9th!
http://www.bioimagexd.org
website up and running after a small glitch ....
sometimes safari browser has trouble loading all the bits of the page (its a plone driven site)
and you have to hit stop for it to show the page....
firefox works ok.

The website is running, just nothing to download yet apart from screen shots!

Dan

Dan White wrote:

theis is a 3D rendering application, using openGL VTK c++ libraries,
wrapped with python,
with the view controlled by the wxPython GUI.
Specifically 3D rendering speed is slow,
using 2D texture mapping of VTK.

I'd say you've got a problem with VTK and/or OpenGL. I'd ask the VTK lists about it. maybe it's not using hardware acceleration?

We've been working recently on a VTK app with C++ wxWidgets, but I haven't had a chance to compare performance between OS-X and other platforms.

I'd love to see your app -- I'd like to use wxPython rather than wxC++ for some of our work, I'd love to see a sample. Your web site doesn't seem to be responding. Is your app open source?

-Chris

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

···

On Jan 31, 2006, at 9:55 PM, Christopher Barker wrote:

Have you tried reproducing these symptoms with a pure VTK-Python
application, i.e. no wxPython?

···

On 2/1/06, Dan White <dan@chalkie.org.uk> wrote:

the frame rate is the same with a small or large window, so its not
the fill rate.
I am jusr looking at the screen and seeing the frame rate visually,
since it is about a 3 or 4 per second on the Mac,
and more than 10 on win and linux. Maybe we can put up a fps
indicator in the render window....

--
dr. charl p. botha - http://visualisation.tudelft.nl/
work: c.p.botha%tudelft.nl other: cpbotha%cpbotha.net

Hi,

After much further testing on Mac OSX vs linux and windows,
it seems that the openGL 2D texture mapping rendering happening inside our wxPython GUI
is slower on the mac due to the lower VRAM (64Mb)
on this machine compared to the linux (256) and windows (128) machines.

If I use a ray casting rendering algorithm that uses the main CPU to generate the 3D image,
not the graphics card
the speeds are almost exactly the same for rendering an image.

so... time to find a better graphics card for this G5 then.....

thanks for all you thoughts!

now we just have to track down the remaining OS X specific GUI bugs
on features that work fine on linux and windows....

the frame rate is the same with a small or large window, so its not
the fill rate.
I am jusr looking at the screen and seeing the frame rate visually,
since it is about a 3 or 4 per second on the Mac,
and more than 10 on win and linux. Maybe we can put up a fps
indicator in the render window....

Have you tried reproducing these symptoms with a pure VTK-Python
application, i.e. no wxPython?

--
dr. charl p. botha - http://visualisation.tudelft.nl/
work: c.p.botha%tudelft.nl other: cpbotha%cpbotha.net

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Dr. Daniel James White BSc. (Hons.) PhD
Bioimaging Coordinator
Nanoscience Centre and Department of Biological and Environmental Sciences
Division of Molecular Recognition
Ambiotica C242
PO Box 35
University of Jyväskylä
Jyväskylä
FIN 40014
Finland

+358 14 260 4183 (work)
+358 468102840 (mobile)
http://www.bioimagexd.org
http://www.chalkie.org.uk
dan@chalkie.org.uk
white@cc.jyu.fi

···

On Feb 1, 2006, at 12:14 PM, Charl P. Botha wrote:

On 2/1/06, Dan White <dan@chalkie.org.uk> wrote: