marshal doesn't work with "file-like" objects

Fredrik Lundh fredrik at effbot.org
Sat Jan 27 05:38:46 EST 2001


Chuck wrote:
> Does anyone really believe that there is any difference in performance?
> Supporting file-like objects would add the overhead of a message pass.

"a couple of thousand message passes", that is.

> But what's taking place here is file I/O that easily ranges from 1K to
> 40K (according to my dir *.pyc).

marshal does lots of single byte reads.  the're only one fread
in marshal, and that's used to read string literals.

> I seriously doubt that if message passing were suddenly employed [a]
> anyone would notice and [b] any Python benchmarks would change.

maybe, but people sure notice when we *improved* marshal's
performance:

    http://deja.com/=dnc/getdoc.xp?AN=715125331

> I win <0.95 wink>.

nope.

Cheers /F





More information about the Python-list mailing list