Ross Ridge <[EMAIL PROTECTED]> wrote:
> It's the same as the previous version except that it "precompiles"
> the struct.unpack() format string. =A0It works similar to the way Python
> handles regular expressions.

George Sakkis  <[EMAIL PROTECTED]> wrote:
>I didn't know about the Struct class; pretty neat. It's amazing that
>this version without Psyco is as fast Bob's version with Psyco!

Unfortunately, it doesn't seem to documented in the Python 2.5 manual.
The speed improvement mainly comes from avoiding the Python code in the
struct module that wraps the Struct class.  The struct module caches
already compiled format strings, but looking format strings in the cache
ends taking a fair chunk of time in my original example.

                                Ross Ridge

-- 
 l/  //   Ross Ridge -- The Great HTMU
[oo][oo]  [EMAIL PROTECTED]
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //   
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to