Comment on Making Old Computers Count To A Million by J. Peterson

I remember getting a new RISC box at work, and wrote a loop to count to a million just to get a rough idea of the CPU speed. It finished -suspiciously- fast (a microsecond or two).

I disassembled the code and discovered the compiler thought the loop was dumb and removed it in favor of just returning 1,000,000.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论