From owner-freebsd-hackers Sun Feb 3 10:30:39 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from energyhq.homeip.net (213-97-200-73.uc.nombres.ttd.es [213.97.200.73]) by hub.freebsd.org (Postfix) with ESMTP id 79B6B37B417 for ; Sun, 3 Feb 2002 10:30:35 -0800 (PST) Received: from kajsa.energyhq.org (kajsa.energyhq.org [192.168.0.1]) by energyhq.homeip.net (Postfix) with SMTP id 7E3803FC4C; Sun, 3 Feb 2002 19:30:36 +0100 (CET) Date: Sun, 3 Feb 2002 19:29:57 +0100 From: Miguel Mendez To: Alfred Perlstein Cc: mime@traveller.cz, hackers@freebsd.org Subject: Re: stack alignment issues (was: unbelievable benchmark output) Message-Id: <20020203192957.4ce563a0.flynn@energyhq.homeip.net> In-Reply-To: <20020203085941.N10817@elvis.mu.org> References: <20020203085941.N10817@elvis.mu.org> Organization: Energy, Inc X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i386--freebsd4.5) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 3 Feb 2002 08:59:41 -0800 Alfred Perlstein wrote: Hi, > It sure looks like an alignment issue. If you print the address > of 'i' and 'j' in the attached program you can see for the fast > case they are aligned to 8 byte boundries, but when it's slow they > are at an address that is a multiple of 4 but not 8. Agreed, my bet is on data alignment. > > Not really sure what to make of this, anyone else know how we ought > to fix this? Well, you could always malloc() some memory and make sure your data is in an address that is multiple of 8. You'll waste some mem but will gain performance. I actually haven't tried it on FreeBSD but it's a trick I used to do on the Amiga some years ago. Cheers, -- Miguel Mendez - flynn@energyhq.homeip.net Public Key :: http://energyhq.homeip.net/files/pubkey.txt EnergyHQ :: http://energyhq.homeip.net FreeBSD - The power to serve! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message