From owner-freebsd-current Fri Nov 15 07:04:12 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA18717 for current-outgoing; Fri, 15 Nov 1996 07:04:12 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA18671 for ; Fri, 15 Nov 1996 07:04:04 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id CAA16104; Sat, 16 Nov 1996 02:01:46 +1100 Date: Sat, 16 Nov 1996 02:01:46 +1100 From: Bruce Evans Message-Id: <199611151501.CAA16104@godzilla.zeta.org.au> To: frankch@waru.life.nthu.edu.tw, freebsd-current@FreeBSD.org Subject: Re: fast libm? Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > Our lab is planning to buy some PPro for scientific calculation. > We have previously test the performance of a PPro 200 running > FreeBSD and another running Linux. > > The performance in the Linux box is 2 times faster than the > FreeBSD box. Through some investigation, we have found that the > problem is due to the math library. The Linux libm is optimized > for i386 machine, and written in assembly. Whereas FreeBSD libm > is written entirely in C. Are you benchmarking it with your applications? It is possible to make the FreeBSD library look very bad by using a benchmark biased towards the slowest functions in it, but I think the slowest functions are rarely used. FPU-intensive code tends to be limited by memory bandwidth anyway. I hope the Linux libm isn't optimized for i386's - i386's don't even have FPU's, and PPro's are quite different. The FreeBSD libm is not entirely written in C - most of the functions directly supported by the FPU are written in assembler and the assembler versions are used if HAVE_FPU is defined in /etc/make.conf. > I wonder whether there's anyone trying to optimize libm in > FreeBSD? I believe this will extend the use of FreeBSD in > scientific realms. Someone who uses it a lot will have to do it. Bruce