2 ms·
> Maybe the largest remaining difference is around the strength of the memory model If it weren't for the following project... I'd agree with you. https://git
by dragontamer 6y ago
> Maybe the largest remaining difference is around the strength of the memory model
If it weren't for the following project... I'd agree with you.
https://github.com/saagarjha/TSOEnabler https://github.com/saagarjha/TSOEnabler
> A kernel extension that enables total store ordering on Apple silicon, with semantics similar to x86_64's memory model. This is normally done by the kernel through modifications to a special register upon exit from the kernel for programs running under Rosetta 2; however, it is possible to enable this for arbitrary processes (on a per-thread basis, technically) as well by modifying the flag for this feature and letting the kernel enable it for us on. Setting this flag on certain processors can only be done on high-performance cores, so as a side effect of enabling TSO the kernel extension will also migrate your code off the efficiency cores permanently.
--------
Its clear that Apple has implemented total-store ordering on its chips (including the M1).
- StillBored 6y agoThat is way cool, the question is can someone compare the perf on a normal mac/arm application with it on/off? Presumably its a hit, otherwise they would have just left it on. I guess its more a question of whether its a .5% hit or a 10% hit.
- dragontamer 6y agoIt would be hard to benchmark. Any single-threaded program wouldn't care at all, because you're just plucking values out of store-buffers (aka: store-to-load forwarding) anyway. There needs to be some kind of multithreaded benchmark, maybe a mutex ping-pong or spin lock ping-pong, to really see the difference. Well... hypothetically anyway. It seems like something that's very hard to actually test for.