Re: Question about mmap wrt compressed files
- From: bybell@xxxxxxxxxxxxxx
- Date: 22 Dec 2005 19:18:36 -0800
How is a wrapper to mmap() going to help? Unless you have wrappers for
all reads/writes to that mmap'd memory, wouldn't you need to intercept
the page fault handler in the kernel in order to do things
transparently to the app as compared to how they are now? That is,
you'd custom mmap the region but individual pages/comprssion blocks are
invalid until decompressed and constructed as needed.
A lot really depends on your app. A while back I wrote an app that did
exactly what you mention where it decompresses gzip/bzip2 data into an
mmap'd region. I did this in order to minimize code tear-up, but yes,
there is a decompression speed hit on initialization. You could try
mmap'ing to /dev/zero as this would keep you from having to generate a
real file, but considering the caching the filesystem does, it'd
probably make no difference or could even be slower than using files.
*shrugs*
-t
.
- Follow-Ups:
- Re: Question about mmap wrt compressed files
- From: Jorge Cruz Rodriguez
- Re: Question about mmap wrt compressed files
- References:
- Question about mmap wrt compressed files
- From: Jorge Cruz Rodriguez
- Question about mmap wrt compressed files
- Prev by Date: huffman encoder
- Next by Date: "Giving Back" to a member of the community
- Previous by thread: Re: Question about mmap wrt compressed files
- Next by thread: Re: Question about mmap wrt compressed files
- Index(es):
Relevant Pages
|