[Expat-discuss] using mmap()

Fred L. Drake, Jr. fdrake at acm.org
Thu Mar 25 01:41:57 EST 2004


On Thursday 25 March 2004 03:28 am, Enrico Weigelt wrote:
 > Does expat currently use mmap() to read in the XML source ?
 > There're several studies out there showing thats much faster simply
 > mapping in a file than sequentially reading it. expat could see
 > the whole xml file (even if its very big) as a block of memory
 > and "let a pointer run" over it.

Expat avoids dealing with I/O at all by having the application provide the 
data via the API.  The "xmlwf" example application does use mmap() on Unix to 
load data for the Expat library.

mmap() is not available on all platforms (though most modern general purpose 
platforms have it in some form); the Windows version of mmap() is different 
from the Unix version even at the API level, so mmap() isn't particularly 
portable.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation




More information about the Expat-discuss mailing list