From: Tony Cox <nospam@nospam.com>
Subject: mmap for fast file access?
Date: 18 Oct 2001 11:10:38 +0100 [thread overview]
Message-ID: <rzwvghd2r8h.fsf@wallaby.sanger.ac.uk> (raw)
Hi,
I have an application that involves parsing a large number of text
files (say 1000 of say 60-100Mb each) and I want to do this as quickly
as possible. At the moment I just read the files line by line into a buffer
(using the C++ getline function). I'd like to speed this up by reading
in the files using memory mapping instead, and the Compaq realtime
programmers guide is pretty clear on how to do this using mmap, but:
1. How much speedup am I likely to get by using memory mapping?
2. When reading a file sequentially, is it faster to mmap it into
memory page by page as needed, or mmap it all at once (presumably the latter,
if you have enough memory)?
3. Would it be faster to use a shared memory approach instead, e.g. shmat?
The machine I'm likely to run this on uses Tru64 UNIX 5.1.
Thanks in advance,
Tony Cox
--
-------------------------------------------------------------
Dr. Anthony J. Cox -. .-. .-. .-. .-. .-
Informatics Division, ||\ /|||X|||\ /|||X|||\ /||
The Sanger Centre, |||X|||/ \|||X|||/ \|||X|||
Hinxton, Cambridge CB10 1SD, UK `-' `-' `-' `-' `-' `-'
-. .-. .-. .-. .-. .-
||\ /|||X|||\ /|||X|||\ /|| ac2 at sanger dot ac dot uk
|||X|||/ \|||X|||/ \|||X|||
`-' `-' `-' `-' `-' `-'
-------------------------------------------------------------
next reply other threads:[~2001-10-18 10:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-18 10:10 Tony Cox [this message]
2001-10-18 20:19 ` mmap for fast file access? Rob Nichols
2001-10-19 0:59 ` Bill Todd
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox