bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mmap visited files?


From: Wolfgang Rupprecht
Subject: Re: mmap visited files?
Date: Mon, 18 Feb 2002 05:04:49 GMT
User-agent: Gnus/5.08 (Gnus v5.8.8) Emacs/20.7

phr-2002@nightsong.com writes:
> This is an idea for some unknown future Emacs.  I wonder if it's
> feasible, when someone first visits a file, to simply mmap it instead
> of reading it all into memory.  This would allow viewing and browsing
> large files to start up a little faster than the current approach.
> 
> Of course if the buffer gets modified, it's messy to not read it all
> in at that point.  So buffer objects would just have a flag saying
> whether the contents were a 'real' buffer or just a mapped file.

I use mmap-ed data files in my gps-mapping program and there is
another big win if one plays one's cards right: free autosaves.  In my
case I temporarily append stuff to the end of the mmap-ed file.  If
the program crashes, the data in the mmaped buffers still gets flushed
to the underlying disk file by the OS.  It sure beats complex autosave
logic.  It might be worth trying a similar hack for emacs -- mmap the
single-gap buffer directly into a temporary file.

-wolfgang
-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
                    http://www.wsrcc.com/wolfgang/
Coming soon: GPS mapping tools for Open Systems. http://www.gnomad-mapping.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]