mmap interface in Python

Mitch Chapman chapman at bioreason.com
Mon Sep 13 12:04:40 EDT 1999


Stephan Houben wrote:
> 
> It sounds cool, but I'm not sure if it buys you all that much
> performance-wise. 

It can.  It eliminates the data copies from kernel address
space to user space that result from traditional file
reads.  The bigger the file, the bigger the potential payoff.

At my previous job we used mmap() in favor of file reads for 
processing large image files.  I can't remember the exact 
performance improvement, but it was significant.

We had just switched to Solaris at the time.  IIRC Sun 
rewrote some utilities like 'cp' and 'cat' to take advantage 
of mmap().  But then, I can't remember what I had for lunch on
Friday, so you can take that with a grain of salt.  Or french 
fries.  Or something.

-- 
Mitch Chapman
chapman at bioreason.com

Of all the things I've lost in life,
I miss my mind the most.




More information about the Python-list mailing list