[Urwid] Re: Unbearable slowness in UTF-8 mode

Nuutti Kotivuori naked at iki.fi
Fri Oct 13 16:33:33 EDT 2006

Ian Ward wrote:
> Ian Ward wrote:
>> Nuutti Kotivuori wrote:
>>> In any case, this slowness is a showstopper for me - and I'm wondering
>>> what would be the best way to optimize this.
>> Currently Urwid redraws all the visible widgets every time you call
>> render.  The Text widgets do cache the result of their alignment and
>> wrapping, but Urwid might be calling calc_width unnecessarily on
>> text it should already know the width of.
> Please try the attached patch.  The Columns widget was causing
> calc_width to be called unnecessarily.

Thanks! I tried the patch and it alleviates the situation a
lot. However, performance is still not good enough. Here is a sample
program to check the performance (not minimal, one of my test files):

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mus.py
Type: text/x-python
Size: 3120 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20061013/3bfcfa00/mus.py
-------------- next part --------------

When run in ISO-8859-1 mode, performance is great - when run in UTF-8
mode, even with the patch, I can easily max out the CPU and have the
display updating really slow by rapidly tapping left and right.

-- Naked

More information about the Urwid mailing list