3 ms·
The situation with x86 specifically is a little weirder than that: http://www.emulators.com/docs/nx06_rmw.htm http://www.emulators.com/docs/nx06_rmw.htm . It'
by 1337p337 14y ago
The situation with x86 specifically is a little weirder than that: http://www.emulators.com/docs/nx06_rmw.htm http://www.emulators.com/docs/nx06_rmw.htm . It's a bit of a long read, but the summary is that on some x86s, single-instruction adds to memory are faster, and on others, load/increment/store in three instructions is faster.
Compiler optimization be a harsh mistress.