5 ms·
But memory access is more expensive. Double de-referencing a pointer to pointer might perform worse.
by ww520 14y ago
But memory access is more expensive. Double de-referencing a pointer to pointer might perform worse.
- stephencanon 14y agoThere is actually no difference in the memory access pattern of the two approaches, unless your compiler is entirely out to lunch. Memory is only touched in either approach to: a. loading the address of the next node. b. updating the link address when a node is deleted. which are performed the same number of times on the same underlying data in either approach.
- kabdib 14y agoSee above comment about load-hit-stores. Memory order and what's in flight in the pipeline matter in surprising ways.