From owner-freebsd-hackers Fri Jan 31 07:17:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA26596 for hackers-outgoing; Fri, 31 Jan 1997 07:17:04 -0800 (PST) Received: from gatekeeper.ctron.com (ctron.com [134.141.197.25]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id HAA26590 for ; Fri, 31 Jan 1997 07:16:58 -0800 (PST) Received: (from news@localhost) by gatekeeper.ctron.com (8.6.12/8.6.9) id KAA16900 for ; Fri, 31 Jan 1997 10:16:57 -0500 Received: from stealth.ctron.com(134.141.5.107) by gatekeeper via smap (V1.3mjr) id sma016775; Fri Jan 31 10:15:40 1997 Received: from dur-mail.ctron.com by stealth.ctron.com (4.1/SMI-4.1) id AA27364; Fri, 31 Jan 97 10:21:36 EST Received: from thoth.ctron (thoth.ctron.com [134.141.65.91]) by dur-mail.ctron.com (8.6.12/8.6.9) with ESMTP id KAA04390 for ; Fri, 31 Jan 1997 10:18:49 -0500 Received: from thoth by thoth.ctron (SMI-8.6/SMI-SVR4) id KAA20051; Fri, 31 Jan 1997 10:17:31 -0500 Message-Id: <32F20D0B.6385@ctron.com> Date: Fri, 31 Jan 1997 10:17:31 -0500 From: Alexander Seth Jones Organization: Cabletron Systems, Inc. X-Mailer: Mozilla 3.0Gold (X11; I; SunOS 5.5.1 sun4m) Mime-Version: 1.0 To: hackers@freefall.freebsd.org Subject: performance puzzler Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I've just run into a puzzling situation: The code consists of protocol messages being encoded into a byte stream, and then decoded back into a C++ object. One of the messages is 200 bytes in length, and I successfully decode it, do all error checking, etc., in about 0.5 milliseconds. This is without -O, and with -m486 and -ggdb. The hardware is an Intel 486-66, running 2.1.5-RELEASE. The puzzling thing comes when I try to run the test at home on my AMD 486-120, running 2.1.0-RELEASE. It runs the test in 0.6 milliseconds!! I decided to do some investigation. I ran the lmbenchmark memory read and write tests on both machines, and the 120 beat the 66 convincingly on every test. I then ran a simple test that incremented an integer 100 million times. It took the 120 between 17 and 18 seconds, and the 66 between 26 and 27 seconds, which is close to the 120/66 ratio I would expect. Why, then, does the 120 run my code slower than the 66? I've double checked and re-double checked the test, had other people look at it, and it is a valid test. Is there an instruction that I'm using a lot that Intel can do that much faster than AMD? Help... -- Alex Jones | ajones@ctron.com Cabletron Systems, Inc. Durham, NH USA 03824