lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <>
Subject Re: Nio File Caching & Performance Test
Date Mon, 15 May 2006 22:30:27 GMT
On May 15, 2006, at 5:41 PM, Robert Engels wrote:
> As stated in the email, it is 3x faster reading from a Java local  
> cache,
> then having Java go to the OS (where it may or may not be cached).  
> It avoids
> the overhead/context switch into the OS.

I read that in the original mail, but your performance test is  
comparing against a RandomAccessFile, not the memory-mapped  
ByteBuffer than the MMapDirectory uses.

Having the NioFsDirectory keep a cache of the file contents inside of  
the JVM seems like a waste of memory, since you are  duplicating what  
the OS is caching. Whereas the MMapDirectory, by mmap'ing the file,  
could directly link through to pages in the OS disk cache.


-- -

View raw message