Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where can I find the x86 instructions execution time? How to find out which instruction is faster or smaller?

share|improve this question - you want the software developer manual for the CPU you are interested in.

Keep in mind that there is no "time" for each instruction, these days. You have out of order execution, memory and register stalls, and instruction level parallelism to take into account.

The raw numbers are in those manuals, though.

share|improve this answer
Also its varies wildly between chips, an instruction which could takes ages on an atom, could, be done ten times faster on a XEON. – James Anderson Feb 9 '12 at 1:20
Don't forget about page misses. The exact same instruction on the same processor (same physical hardware) could takes order of magnitude differences in time. – mattnz Feb 9 '12 at 1:28
+1: It's completely unknowable. – DeadMG Feb 9 '12 at 4:46
Not completely, although it is less deterministic than might be nice. You can certainly, for example, get value out of selecting appropriate assembly level representations of operations, or understanding the relative cost of operations at a statistical level - or even a "based on queried cache size" level. – Daniel Pittman Feb 9 '12 at 4:53

Daniel already summed up the answer, +1 to that. Bottom line is that on modern CPUs with over 2 billion transistors, they do such crazy things that you can't look at assembly instructions and expect to guess timing. The only thing you can really do is write code and measure its performance.

On that note, if you are curious about learning more, take a look at The guy who wrote that article is a PhD and actually has a lot of cool things to say about many things. I've spent some time going through all his articles. The one I'm linking talks about measuring performance of exception handling and he goes right down to assembly instruction level.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.