"Walter Bright" <[email protected]> wrote in message news:[email protected]... > Nick Sabalausky wrote: >> "1. Using a profiler >> 2. Looking at the assembly code being executed" >> >> Somehow I knew you were going to say that ;) > > What's interesting is how controversial this is. I've heard every reason > in the book (and some very inventive ones) justifying not using a profiler > or looking at the assembler.
You also need to understand things that can cause problems with asm. For example the Borland compiler used to and probably still does often copy doubles by using 2 32 bit moves. This means any time they are loaded into the fpu soon after a copy you'll get a store to load forwarding stall, which can be around 30 cycles penalty. As float/doubles are passed via the stack, this meant quite a performance hit for code that used doubles over code that used single precision or extended. (Extended was coppied via the FPU so it want a problem).
