On Thursday, February 12, 2026, at 9:08 AM, hiro wrote:
> you're saying you want the software to be more simple, but at the same time 
> you say you want to exploit some techniques that make the hardware use more 
> efficient.
> the first goal is commendable, but for the second you have to first 
> understand how the hardware actually works. i suggest you share the insight 
> that makes you believe mmap is "more efficient" than reading a large file.
I don't think it is, and I don't think I ever said it was more efficient, did I?
I think having the whole file in your address space makes it easier to select 
the bits of the file you want to read - assuming you don't need to read all or 
even most of it.
Being that selective probably only makes a significant speed difference when 
the file is large, anyway.

I've built a couple of simple disk file systems. I thinking of taking the cache 
code out of one of them and mapping the whole file system image into the 
address space - to see how much it simplifies the code. I'm not expecting it 
will be faster.

On Thursday, February 12, 2026, at 12:38 PM, hiro wrote:
> If you poke at it sparsely then reading it into memory is what you should 
> avoid, thus you use seek and normal read instead. that is more simple, 
> efficient, optimal.
I'm sure that's been argued to death over the years. But in a lot of situations 
I'd agree with you. It's going to be a tradeoff.

My interest is in simpler software - so I'm exploring a way get some of the 
effect of mmap without having actual mmap - by making it an implementation 
detail.
------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Te8d7c6e48b5c075b-Mdbd5febf25c74da357aee4b1
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to