There are actually several reasons, but one of the most important is that all CPUs have at least a level 1 (L1) cache, and most have a considerably bigger (but slower) L2 cache. I think typical sizes for a PC might be 16 KB and 2 MB, respectively. As a result, a lot of caching occurs in hardware. A second reason is that modern CPUs essentially restrict memory references to loads and stores, so that if a memory location is referenced multiple times, it may actually still be available in a register. Yet another reason is that there is a lot of concurrency in modern CPU. Memory operations may be started and not completed until many cycles later, but other operations (such as unrelated arithmetic operations) can proceed in parallel. But, of course, globals exhibit a high degree of locality. When you read from a global (or any array) entire blocks of data are read, so if you are, say, $ORDERING through a global, most of your "reads" will be cache hits. This same degree of locality may not hold for other memory references, or successive reads may be separated enough in time that the cached entries are lost. Global nodes are also generally quite small making it less likely that a read will flood the cache. There's no doubt more to it, too. These are all general hardware principles, but a MUMPS implementation is sure to have quite a bit of SOFTWARE caching, too.
===
Gregory Woodhouse
[EMAIL PROTECTED]

"Nothing is as powerful than an idea
whose time has come."
-- Victor Hugo


On Aug 25, 2005, at 6:11 PM, smcphelan wrote:

1. Can you explain why memory references are very slow but accessing global
caches (which is stored in memory) is very fast?  Aren't they both
references to memory?



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to