Going the assembler way
Sometimes, when you definitely have to squeeze everything from code, there is only one solution – rewrite it in an assembler. My response to any such idea is always the same – don’t do it! Rewriting code in an assembler is almost always much more trouble than it is worth.
I do admit that there are legitimate reasons for writing a program in assembly language. Looking around, I quickly found five areas where assembly language is still significantly present – memory managers, graphical code, cryptography routines (encryption and hashing), compression, and interfacing with hardware.
Even in these areas, situations change quickly. I tested some small assembler routines from the graphical library GraphicEx and was quite surprised to find out that they are not significantly faster than equivalent Delphi code.
The biggest gain that you’ll get from using an assembly language is when you want to process a large buffer of data...