1996-12-15 - Re: ASM vs portable code [WAS: Re: Java DES breaker?]

Header Data

From: Dale Thorn <dthorn@gte.net>
To: trei@process.com
Message Hash: 49ca0a84361d8e2d0253fed57221d3bf934c1b2671ee81317e1c70de155816d7
Message ID: <32B38C8E.484C@gte.net>
Reply To: <199612131459.GAA06660@cygnus.com>
UTC Datetime: 1996-12-15 06:04:27 UTC
Raw Date: Sat, 14 Dec 1996 22:04:27 -0800 (PST)

Raw message

From: Dale Thorn <dthorn@gte.net>
Date: Sat, 14 Dec 1996 22:04:27 -0800 (PST)
To: trei@process.com
Subject: Re: ASM vs portable code [WAS: Re: Java DES breaker?]
In-Reply-To: <199612131459.GAA06660@cygnus.com>
Message-ID: <32B38C8E.484C@gte.net>
MIME-Version: 1.0
Content-Type: text/plain

Peter Trei wrote:
> Ray Arachelian <sunder@brainlink.com> 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]