3 ms·
While it is correct that memory is orders og magnitudes slower than modern cpus, this is also why cpus sport multiple levels of caches. memcpy operations (and
by useerup 7y ago
While it is correct that memory is orders og magnitudes slower than modern cpus, this is also why cpus sport multiple levels of caches.
memcpy operations (and base 64 encoding/decoding) are highly "local" operations. When the segment of memory they operate on has been placed in the cpu level1 or level2 caches, the operation is much faster and will not need to access main memory for each byte/word. Only when a memory barrier is encountered will the cpu need to flush/refresh to/from main memory.