Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* mmap for fast file access?
@ 2001-10-18 10:10 Tony Cox
  2001-10-18 20:19 ` Rob Nichols
  2001-10-19  0:59 ` Bill Todd
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Cox @ 2001-10-18 10:10 UTC (permalink / 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|||    
   `-' `-'   `-' `-'   `-' `-'
 ------------------------------------------------------------- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-19  0:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-18 10:10 mmap for fast file access? Tony Cox
2001-10-18 20:19 ` Rob Nichols
2001-10-19  0:59 ` Bill Todd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox