News for hackers. Stuff that matters.
Re:Base64 encoding and decoding at almost the speed of a mem... by useerup on Wednesday November 06, 2019 @04:23AM (#21460920)
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.

There are no comments on this comment yet.