[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASM vs portable code [WAS: Re: Java DES breaker?]



Peter Trei wrote:
> Ray Arachelian <[email protected]> wrote:
> > On Wed, 11 Dec 1996, Dr.Dimitri Vulis KOTM wrote:[snip]
> For this test, I modified the code to cut out the delays associated
> with incrementing the key schedule, leaving the most of the
> crunching in the DES decryption. Both versions were compiled
> under Visual C++ 4.0, with Optimizations set to 'Maximize speed',
> and inlines to 'any suitable', and run on a 90MHz Digital
> Celebris 590 under WinNT 3.51.
> Averaging several runs:
> "C":   102,300 crypts/sec
> ASM:   238,000 crypts/sec

I remember sitting down with some ASM programmers in the mid 1980's
(using x86 PCs), and at that time, looking at the Codeview tracings,
it occurred to me that ASM would nearly always run 2x faster than 'C',
something that is inherent in the processes.

Someone on this list should know if it is possible to maximize speed in
a typical 'C' routine, using Register variables (particularly for loops),
inlining everything possible, etc., to get executable code much closer
than a factor of 2x difference.  Can it be done on a PC, and how hard
would it be to explain, to cover a representative variety of techniques?

[snip remainder]