foreach counter now must be size_t ?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Feb 6 22:29:11 UTC 2019


On Wed, Feb 06, 2019 at 10:00:35PM +0000, jmh530 via Digitalmars-d wrote:
[...]
> mmap is something that I never really played around much with, but it
> seems like it would be useful for me in some cases. I've done some
> Monte Carlo simulations that end up causing me to run out of memory.
> Doing it as an mmap instead might be slower but at least I wouldn't
> run out of memory.

It depends on how big your resident set size is, and what your memory
access patterns are.  If you're using the mmap'd memory in a
random-access pattern, be prepared for your OS to slow down to a crawl
as it begins thrashing on I/O swapping pages from disk only to evict
them milliseconds later because there's no more memory to load in the
page for the next random access.

There's no free lunch. :-P

That's why in this day and age people are moving away from hashtables,
once hailed as the holy grail of data structure design, to structures
based on linear access that have "worse" big-O complexity but better
real-world performance, because linear access plays nicer with the cache
hierarchy.


T

-- 
"How are you doing?" "Doing what?"


More information about the Digitalmars-d mailing list