11 ms·
>Setting typecodes and vals doesn’t slow things down by many orders of magnitude. What about blowing the cache by having every access involve multiple pointer
by katastic 9y ago
>Setting typecodes and vals doesn’t slow things down by many orders of magnitude.
What about blowing the cache by having every access involve multiple pointer dereferences?
Virtual calls are absolutely slower than normal calls.
But yeah, 100x is not likely from virtual calls unless you're forcing a cache invalidation on every access. Running a CPU without cache brings you down 100x-200x (literal) in performance on most modern machines.
(The Cell CPU was almost exactly 200, which is why Sony did TONS of PR and tech talks on Data-oriented Design because the Cell would be useless without cache aware programming.)
But on further reflection, you said "this is one source of 100x, not unboxing on its own" so we're more in agreement than disagreement I guess. My point is that virtual calls and dereferences can definitely be a huge performance hit if the cache/TLB can't keep up with it.