4 ms·
> maybe I'm missing the instructions to do it? Yes, they’re called “non-temporal” load and store instructions. AFAIK most memcpy implementations will automatic
by NobodyNada 4y ago
> maybe I'm missing the instructions to do it?
Yes, they’re called “non-temporal” load and store instructions. AFAIK most memcpy implementations will automatically use non-temporal access when copying blocks larger than a certain threshold, precisely to avoid destroying the cache during bulk copies.
Additionally, a well-optimized memcpy implementation (e.g. making good use of prefetch hints) should not suffer too much from RAM latency and be able to pretty much max out the bandwidth available to the CPU core.
- chrisseaton 4y agoYou're thinking of like MOVNTDQA? Those still have to reach into RAM - that's still double-digits nanoseconds away and still creates a stall in the processor at n complexity!! No thanks? I can allocate a new linked list node with memory guaranteed already entirely in cache (except for TLA failure.) > be able to pretty much max out the bandwidth available to the CPU core Why max out a slow link at n complexity when you can just avoid doing that entirely and use a linked list?
- deleted 4y ago[deleted]
- Dylan16807 4y agoSurely you know the answer, if you're analyzing at this level of detail? It's because spending 1 millisecond per X operations doing vector moves is preferable to spending 20 milliseconds per X operations stalling on list links. If you set a good vector size from the start, the moves will be rare to nonexistent. Or you could reserve some address space and never have to move the data.