On Fri, 28 Jul 2000, Kenneth Lee wrote:

> it would be good for the user to choose between mmap or normal i/o at 
> compile time. i'll try HTML::Tree anyway in the meantime.

        It's not that simple.  Using mmap(2) greatly affects how one
        writes code: it's not a drop-in replacement for standard I/O.
        An mmap'd file *becomes* memory in the time it takes the OS to
        handle a page-fault.  You then further get speed by accessing
        the file *as* memory via ordinary pointers rather than function
        calls and I/O buffers.  Inside the HTML Tree code is a generic
        C++ STL-style container class wrapped around mmap...quite nice
        if I do say so myself.

        By definition, file I/O off disk can't be faster than mmap(2).

        - Paul

Reply via email to