A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Marc » Tue Aug 13, 2013 6:33 am
Hi !
I'm not sure this is still important, but I remember Julio expertimenting with mingw vs. vc and mingw creating faster code for Newton. The idea arose to use the mingw libs for vc programs as well and as far as I remember, we didn't knew how. By accident, I found a solution: I needed a 64bit Version of fftw, the fast Fourier transform library. A few years ago I compiled a 32bit Version myself in vc, but now I saw there were ready to use dlls for Windows which were compiled with mingw for 32 and 64 bit. Also, they show how to use those libs in vc and I did that and it worked. So I assume, this might work for Newton as well and might be beneficial if the Performance difference still exists with the current Versions of the Compilers:
from
http://www.fftw.org/install/windows.html:
These DLLs were created by us, cross-compiled from GNU/Linux using MinGW; the 64-bit version is possible thanks to the mingw-w64 project. You should be able to call them from any compiler. In order to link to them from Visual C++, you will need to create .lib "import libraries" using the lib.exe program included with VC++. Run:
lib /def:libfftw3-3.def
lib /def:libfftw3f-3.def
lib /def:libfftw3l-3.def
On Visual Studio 2008 in 64-bit mode, and possibly in other cases, you may need to specify the machine explicitly:
lib /machine:x64 /def:libfftw3l-3.def
Executing that, you get .lib files which you can use in vc.
-

Marc
-
- Posts: 281
- Joined: Sun Mar 14, 2004 4:07 pm
- Location: Germany
-
by Julio Jerez » Tue Aug 13, 2013 7:44 pm
Oh that was back when usin VS 2005.
Later I foudn out why that was, In 32 bit visual studion generate x87 code no matter what option you pass.
in Linux and Ming win were usin a Make fiel that was setting the sse2 option, so the binary generetad by GCC was alway batter.
recently I mak eteh dgMath class a SSE a SSE class, and alone made netwon 300, over 20 % faster.
Before I have teh SSE optional, by it was too much work to maintain, so I decide that SSE was goin to be a compile option not arun tiem options.
right now GCC and Misual studio (2009, 2010 and 2012) generate code that run about the same speed.
There is one difference, it seem that the overhead for calling a Semaphore in Linux and OS10 cost more than in windows.
for example an idle loop running asyncronous ideally sopuld take zere time, of non mesurable time, however
the cost Semaphores make 0.02 milisecunds. in Lunix teh same loop this is about 0.1 and in OS10 is even higher about 0.2 ms for an idle loop.
I return for that fix overhead we get a Physics loop that is independent of the Body count in the scene as
long as the rendering time is equal or larger than the simulation time. which for practical porpuse means the physics is free in Newton 300.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests