2 ms·
> But for the single threaded version I still seen spikes across all cores is this some CPU magic and if so what techniques are involved? The kernel must be mo
by chrisseaton 6y ago
> But for the single threaded version I still seen spikes across all cores is this some CPU magic and if so what techniques are involved?
The kernel must be moving the Ruby process around if you're looking at the single-threaded case. That doesn't sound right though - moving a process to a different core damages its cache. But Ruby doesn't influence that it's down to the OS. Maybe the kernel has some subtle good reason to do it if you're running other services in the background?
> What do you mean by this?
Ractors acquire locks and CAS to do things to update the VM on what they're doing. They don't run entirely purely in parallel. GC is the big example. This benchmark shouldn't really need to use the GC... but maybe it does. Does your system malloc have a global lock too?
- JW_00000 6y ago> Maybe the kernel has some subtle good reason to do it I think OSes spread load across cores to prevent unequal heating across the chip.
- chrisseaton 6y agoHmm that’d be a disaster for cache I think that’s extremely unlikely but I’m not an OS expert.
- CyberDildonics 6y agoYou are comparing something that happens on the scale of multiple seconds to something that happens on the scale of microseconds.
- pjmlp 6y agoIf you want a process to stay put in a specific core, you need to ask the OS for it, however this might still influence the performance, as naturally there are other processes running there and the OS cannot honour the request if everyone does the same. However it already improves not copying the process context across all cores. I used this to good effect back in the Windows NT/2000 days, whose scheduler wasn't that smart about when to move processes across cores.