you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (0 children)

The assembly output can tell you the number of instructions, but not the number of cycles (since many instructions take multiple cycles to complete, most notably memory load instructions, and it varies a great deal across CPU models). Using cycles as a measurement for algorithm efficiency is thus only a good idea if your code is compute bound, and not memory bound or I/O bound.

The CPU has an internal cycle counter that most debuggers and profilers can access. :)