This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mmap support in stdio


You might have seen the changes I just checked in, they add
transparent support for the use of mmap in stdio.  mmap is only used
of read-only streams.  It is theoretically possible to use mmap also
otherwise but this is so much more complicated that I don't even want
to think about it.  One oddity of the code is that I've limited the
size of files handled this way to one 1MB on 32-bit machines.
Otherwise the address space might fill up too quickly.  The number
(1MB) is pure guessing.  Maybe it'll have to be changed in future.

As for the benefits: I've measured about 10% speed-up on large files.
Smaller files should benefit less.  This also shows that the original
code is already pretty well optimized.

The code certainly needs testing but at least all the tests in libio/
and stdio-common/ pass.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]