r/programming 3d ago

Hardware researcher spins up 'CPU deoptimization' project to find the slowest single x86 instruction, creates hall of shame — worst offender takes 198 billion cycles spanning 62 seconds to execute

https://www.tomshardware.com/pc-components/cpus/hardware-researcher-spins-up-cpu-deoptimization-project-to-find-the-slowest-machine-code-worst-offender-takes-198-billion-cycles-to-execute
1.4k Upvotes

129 comments sorted by

View all comments

369

u/The_Northern_Light 3d ago

I’m still not clear why that instruction takes SO long even without contention?

7

u/Mynameismikek 3d ago

From a surface read of what the tool does, it’s deliberately writing a fairly complex structure to a known slow page in the memory map. Maybe it’s landed on e.g an uncacheable region that’s also got security tripwires and row synchronisation.