From owner-freebsd-alpha Wed May 15 0:33: 9 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from gnah.bolet.org (gnah.bolet.org [80.65.226.87]) by hub.freebsd.org (Postfix) with ESMTP id 87E4C37B404 for ; Wed, 15 May 2002 00:33:04 -0700 (PDT) Received: (from pornin@localhost) by gnah.bolet.org (8.11.6/8.11.6) id g4F7X1V50396 for alpha@FreeBSD.org; Wed, 15 May 2002 09:33:02 +0200 (CEST) (envelope-from pornin) Date: Wed, 15 May 2002 09:33:00 +0200 From: Thomas Pornin To: alpha@FreeBSD.org Subject: Re: Alpha CPU Performance vs i386 Message-ID: <20020515093259.A50064@gnah.bolet.org> References: <20020514201923.GK37326@Area51.DK> <20020514222344.A2915@freebie.xs4all.nl> <20020515161627.O18023@gsmx07.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20020515161627.O18023@gsmx07.alcatel.com.au>; from peter.jeremy@alcatel.com.au on Wed, May 15, 2002 at 04:16:27PM +1000 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, May 15, 2002 at 04:16:27PM +1000, Peter Jeremy wrote: > ssh between an ES40 EV6/500 and a PIII-600 suggests that the PIII-600 > is around 50% faster at running blowfish. Cryptographic code is usually not a very good benchmark for comparing a PC with a non-PC, unless what you are interesting in is actually performing that very same cryptographic operation. There are multiple reasons to that: -- Software which includes some cryptographic operation often uses a hand-made specially optimized assembly implementation for the PC, and a generic portable C implementation for everything else. Call it market pressure if you like. The bottom-line is that the generic portable implementation will not use more than 32 of the 64 bits of the Alpha. -- Some cryptographic algorithms are specially designed to fit well an architecture, and this architecture is often the PC. Blowfish was designed to be acceptable on all architectures, but this was in 1993, and in 1993 there was no problem in using byte-indexed arrays, which are more efficient on the PC than the Alpha. As extreme examples, one might speak of RC5 (completely PC-bound with data-dependant rotations of 32-bit values, which are very slow to perform on most non-PC architectures), and DFC (candidate to the AES normalization process, blazingly faster on the Alpha than on anything else because it uses a 64x64->128 bits multiplication). I have used as my main working machine a Miata for three years (under Linux first, then FreeBSD) and I came to the following conclusions: -- The PC will performe better than the equally-clocked Alpha on byte-intensive stuff, such as string handling, pattern matching and so. -- The Alpha will utterly crush the PC at floating point operations, especially when using the Compaq compiler. Actually, the Compaq compiler comes with an optimized math library (libcpml), slightly less precise but much faster. I compiled the "lame" MP3 encoder with gcc, and simply linking the binary with libcpml rather than the GNU libm yielded an executable thrice faster. -- The two preceeding conclusions are only mostly true. On any specific task, your mileage may vary greatly. --Thomas Pornin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message