|
From: Greg C. <chi...@co...> - 2006-03-20 16:06:47
|
On 2006-3-20 15:35 UTC, Douglas Vechinski wrote:
>
> there is a huge speed difference with the math functions used when
> compiled with Cygwin -mno-cygwin and Msys/Mingw as compared with Linux,
> .Net or native Cygwin.
>
> Are the Msys/Mingw executables using a different library for the math
> functions than does .Net? Anyone with any insight as to why the math
> functions when native windows executable is compiled with gcc are so
> much slower than all the other platforms.
The standard C runtime libraries differ:
MinGW uses the msvc library distributed with msw
msvc probably uses a later version of that same library, and might
link it statically rather than dynamically
cygwin uses newlib
MinGW implements some functions in its own mingwex library. You can see
which ones by looking at that library's cvs. At one time, it had a pow()
implementation that was slower but more accurate than msvc's.
Any compiler can choose to use intrinsics instead of calling library
functions. For example, a call to sin() might be replaced with an inline
FSIN instruction. Simple replacements like that might not comply with
the C standard's requirements for setting errno or whatever. Some
compilers might favor standard conformance by default, while others
might favor speed.
|