Re:Some Insights from a Julia Developer
by 3JPLW on Saturday October 14, 2017 @07:20PM
(#15474883)
This is easily testable:
Yes, there's an extra operation or two in there, but it's effectively free on modern CPUs due to caching/op latencies/pipelining/etc.
[ Parent
| on HN ]
Re:Some Insights from a Julia Developer
by StefanKarpinski on Sunday October 15, 2017 @06:02PM
(#15479574)
The performance is the same because the core loop in both cases is identical:
loop:
vaddsd (%rcx), %xmm0, %xmm0
addq $8, %rcx
addq $-1, %rax
jne loop
There's more setup required for offset arrays, but otherwise there's no difference. I'm not sure why arrays having an offset would be any more work: array indexing in general involves adding an index to a base pointer; having an offset effectively just changes what the base pointer value is.