[lkml]   [1997]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Aigning the stack can make a difference, but I have a more likely
candidate: operand size prefixes. If the code does a lot of
16-bit math and not much 32-bit math, and runs in 16-bit mode
under DOS and Windows, but in 32-bit mode on Linux, all of those
operand size prefixes (one cycle each, non-pairable) can eat a lot of

I know some PC programmers who habitually use "short" everywhere
instead of "int" when they really don't care, and it costs.

One time I was working on an inner loop, which I had hand-coded
in assembly to get maximum speed out of it. Then I looked at the
overhead of the next loop out. (Basically, I compared the timing
of 10 inner loops of 1000 iterations each with 1000 inner loops
of 10 iterations each. The difference is 990x the overhead per
outer loop iteration.)

Changing one variable from "short" to "int" made a noticeable

 \ /
  Last update: 2005-03-22 13:38    [W:0.023 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site