[Urwid] Urwid benchmarking tool and results

Julien Muchembled jm at jm10.no-ip.com
Sun Jan 14 14:48:22 EST 2007


> I don't really like my "solution" though -- It only works if you don't 
> use any interesting Unicode characters.
Indeed. Any line with a character that isn't in SAFE_ASCII_RE slows down
the application a little more, at such a point that 0.9.7.2 might be
slower than 0.9.7.1.
Whereas in my tests, the solution with a cache is as good as the
SAFE_ASCII_RE one and doesn't have this drawback.
So at the beginning, I didn't like [48] and preferred Haypo's solutions.

Now I don't know what to think, because I did my tests with Hachoir only.
It's not surprising that the cache solution always works well but it may
not be the case with other applications.
Hard to say, but I doubt a cache would fail as much as SAFE_ASCII_RE.

Haypo suggested 2 cache implementations.
The first is so simple that it has a memory leak.
And the second uses deque that appeared in Python 2.4.
I've attached a third one that remains simple, without those problems.

Even if this cache isn't a less awful hack that SAFE_ASCII_RE, I hope
you will consider it.
Haypo's urwid-unicode-v7.patch [1] (yes, it conflicts with [48]) is
certainly a smarter approach.

JM

[1] http://lists.excess.org/pipermail/urwid/2006-December/000387.html


-------------- next part --------------
A non-text attachment was scrubbed...
Name: urwid-cache.diff
Type: text/x-diff
Size: 1011 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20070114/fc7541f4/urwid-cache.bin


More information about the Urwid mailing list