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

echuck3 at my-deja.com echuck3 at my-deja.com
Mon Jan 29 11:47:53 EST 2001


In article <aORc6.9326$AH6.1567365 at newsc.telia.net>,
  "Fredrik Lundh" <fredrik at effbot.org> wrote:
> Chuck wrote:
> > It would be even faster to simply write the marshal results to
memory
> > first and then blast them out to disk in one fell swoop, e.g.
> > ultimately one fprintf() call.
>
> See Tim's post at the start of this thread.
>
> Cheers /F
>

I must be missing which post you refer to. I ultimately responded to
the Tim Peters post that I see.

I guess at some point I'll just have to hack this myself and report the
benchmarks. Do you see what I'm saying about speed, though? It's
generally faster to do operations in memory and then write one long
byte string than it is to repeatedly write a small bits of data to disk.

And once you're writing just one byte string for a single .pyc, the
overhead of one method invocation becomes trivial.

-Chuck


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list