About precomputing hash values
Posted Aug 25, 2006 0:29 UTC (Fri) by bluefoxicy
In reply to: About precomputing hash values
Parent article: Optimizing Linker Load Times
yeah the increase is 1-2 pages (4-8KiB) and the kernel does read-ahead caching and the read time when doing a linear read is nothing. Seek time is what kills you really; if you try to read 1 byte at a time over and over, versus read in 512 byte blocks, you'll find it takes hours to do byte by byte what takes 3 seconds to do 512 at a time (in DOS; Linux has some kind of cool read-ahead algorithm that prefetches the next few sectors).
This is a gain because the stuff winds up in adjacent memory and then CPU cache handles it much more gracefully. We also have a LOT less running back and forth to do so we don't have to read massive amounts of memory over and over and over again. (read Drepper's paper and take note of i.e. C++ common prefixes).
to post comments)