[wxpython-users] On performance

30 of 31
Pablo Antonio
On Wed, Apr 22, 2009 at 02:50:01PM +0200, Nitro wrote:
> Am 22.04.2009, 14:28 Uhr, schrieb Nitro <nitro@dr-code.org>:
>
>> Am 22.04.2009, 04:38 Uhr, schrieb Robin Dunn <robin@alldunn.com>:
>>
>>> Christopher Barker wrote:
>>>> if self.USE_NUMPY:
>>>> bmp = wx.BitmapFromBuffer(width, height, self.__bytes)
>>>>
>>>
>>>> the first should be a simple pointer transfer, though it may make a
>>>> copy of the data.
>>>
>>> The wx.Bitmap's internal pixel buffer format is platform dependent
>>> and is not likely to be the same format as the buffer expected by
>>> wx.BitmapFromBuffer. However the copy that is made inside
>>> wx.BitmapFromBuffer (from the buffer to the wxBitmap) is using the wx
>>> raw bitmap APIs that, while abstracting out the platform differences,
>>> is still doing essentially a C pointer to pointer copy of the bytes.
>>> So given the circumstances it should be as fast as possible. It's
>>> still a copy though, so takes O(N) time to be done.
>
> Just as a little follow-up to my last post, you might try to use RGBA
> instead of RGB. In some cases I have found RGBA to be faster, probably
> because a) the driver uses rgba internally and has to convert rgb to rgba
> before it can be used and b) because rgba is 32-bit aligned in memory
> which processors somehow like. Not sure if all of this also applies to
> RGB/RGBA in wxPython/wxWidgets.
>
Nice tip! I'll give that a try. Thanks :)
--
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-->

[wxpython-users] On performance

31 of 31
Pablo Antonio
On Wed, Apr 22, 2009 at 12:56:18PM +0200, Werner F. Bruhin wrote:
> Hi Pablo,
>
> Pablo Antonio wrote:
>> On Tue, Apr 21, 2009 at 7:08 PM, Pablo Antonio <pabloa@gmail.com
>> <mailto:pabloa@gmail.com>> wrote:
>>
>> Now this is fixed. However, since I'm working on the windowing
>> algorithm the code could break any moment :) So be aware of that if
>> you happen to checkout now from svn.
> Just FYI, now it works find on Windows Vista .
>
> Played around with the timer setting (Intel Core Duo 6300 1.86 Ghz - 4
> GB Ram).
>
> 1. initial value 300 = CPU usage: 30 - 45 %
> 2. value 100 = CPU usage: 50 - 55 %
> 3. value 1 = CPU usage: 50 - 67 %
>
> Animation is a bit slower in case 1, no significant difference between
> case 2 and 3 - but this is difficult to judge just be looking at one
> after the other.
Thanks for taking the time to test this :) I really appreciate it.
>
> Might be interesting to have an option where you can say e.g. do "n"
> animation iterations and measure start and end.
>
Yes. I'll make a better profiling of this when I get the time.
Thanks again,
--
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-->
Previous 10