🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41411

Re: gcc math libraries - slow?

#41411
From: Joe Buck
Date: Wed, 27 Mar 1996 00:00
25 lines
1650 bytes
rmarsh@plains.nodak.edu (Ronald Marsh) writes:
>I have been running a neural network program (that I compiled using gcc
>2.5.8) and I have noticed that the program (while running under Linux) is
>about 40% slower than the same program (running under DOS and compiled
>with Turbo C). I have narrowed the possible causes of the poor performance
>down to the transcendental functions (cos, exp, etc). Does anybody know of
>a "better" math library or version of gcc, with respect to math performance?

You might try experimenting with the following flag (quote from the
gcc manual):

@item -ffast-math
This option allows GCC to violate some ANSI or IEEE rules and/or
specifications in the interest of optimizing code for speed.  For
example, it allows the compiler to assume arguments to the @code{sqrt}
function are non-negative numbers and that no floating-point values
are NaNs.

I don't know if the Linux C library has improved any in the last year
or so (if you have gcc 2.5.8 you presumably have a relatively old C library)
-- 
-- Joe Buck 	<jbuck@synopsys.com>	(not speaking for Synopsys, Inc)

Work for something because it is good,
not just because it stands a chance to succeed.	   -- Vaclav Havel
Technical Details
Message-ID: <4jafjs$eu0@hermes.synopsys.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4j6g4i$1oh@daily-planet.nodak.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,dd030c79dee5c941
X-Google-Attributes: gid11318c,public
From: jbuck@synopsys.com (Joe Buck)
Subject: Re: gcc math libraries - slow?
Date: 1996/03/27
Message-ID: <4jafjs$eu0@hermes.synopsys.com>
X-Deja-AN: 144430620
references: <4j6g4i$1oh@daily-planet.nodak.edu>
organization: Synopsys Inc., Mountain View, CA 94043-4033
newsgroups: gnu.gcc.help