Why?

Walter Bright newshound2 at digitalmars.com
Tue Apr 9 17:18:02 UTC 2024


On 4/5/2024 5:20 PM, Adam Wilson wrote:
> Now ... to convince Walter that loading the whole archive into RAM once will be 
> better than mem-mapping...
> 
> RAM is cheap and source code is not a big memory hit.

There's a switch in the source code to read it all at once or use memory 
mapping, so I could benchmark which is faster.

There's no significant difference, probably because the files weren't large enough.

BTW, I recall that executable files are not read into memory and then jumped to. 
They are memory-mapped files, this is so the executable can start up much 
faster. Pieces of the executable are loaded in on demand, although the OS will 
speculatively load in pieces, too.


More information about the Digitalmars-d mailing list