[Stackless] verify my performance numbers?
Andrew Dalke
dalke at dalkescientific.com
Tue Jan 30 03:37:36 CET 2007
On Jan 29, 2007, at 12:13 AM, Santiago Gala wrote:
> My version substitutes the bloated and hyperlocked Queue class by a
> deque + simple locking, using with for cleaner code.
Interesting. I didn't think about that because the deque class
doesn't have built-in guarantees that it would be usable across
multiple threads. It works in CPython because of the implementation
guarantees, but I don't know know if that can be considered portable.
Because the CPython implementation uses a C type and none of the
append or pop calls are re-entrant it works.
> A substantial part of the overhead, thus, is due to the Queue class,
> though
> stackless is still 50%+ faster than a simple deque+lock solution, plus
> cleaner code
In checking the analysis I did realize that the thread doing
the pushes onto the Queue/deque (the producer side) can be faster
than the consumer. I tested it and found that the Queue can have
several thousand pending messages while the stackless version of
course only has one.
Using Queue.Queue(1) nearly doubled the run-time but I need
to verify that. I got the exception
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
and need to figure out what that means.
Also, the iTunes XML has a reference to a DTD and the expat
parser interface tries to resolve it, so part of the overhead
is doing a network lookup of
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"
Andrew
dalke at dalkescientific.com
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list