Advertisement

A DLL Challenge ! :)

Started by March 06, 2001 04:38 PM
6 comments, last by Fresh 23 years, 10 months ago
Ok peeps, I set upon you a compilation challenge I''ve tried and tried, fiddling with all the settings I can find, but I still cannot get a dll to compile to as fast as code under msvc6 as I could with msvc4, even with optimisations etc. Fortunately, I still have old copies of that dll, but now I want to add new data to it, I need to be able to get it to compile to run as fast I used to. The actual dll is very simple, so perhaps some simple redesign might be the answer. But the baffling thing is, with the *exact* same code, I get a faster dll under msvc4. If anybody''s bored, or is nifty with their compiler settings, then please feel free to get back to me with the correct settings and proof (ie. the supah fast dll ). If you want to check whether or not it''s faster than the old dll, then get the program at www.razors.org/tee.zip (~500kb). The dll included with that is the old, fast one, generated by the same code as I have now, but under msvc4. To get feedback on benchmarks in this program, press tab to toggle the console on, and use the electron probability setup on any state, and it will give you a time taken figure. A typical value with the old dll is 1500. With a newly compiled version it can be 4000 . The source for the dll is here: http://www.razors.org/dll.zip. Thanks for participating . r. "The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."
Test computer: Pentium233 w/ 96mb ram, 4mb vid card (my celeron doesn''t like 24bit colour, maybe you should give an option for 32 or 16 bit)
Results:
Old DLL:
3069 & 3071
New DLL: (Compiled under MSVC6 Proffesional, Release build, optomizations set to max speed)
3065 & 3059

Advertisement
What :?) Hot damn ! .

Try www.razors.org/States2.dll

That was compiled under msvc6 pro, and gives times of 2500 for the 4pz, as opposed to 1500 under the old dll. Try it on your machine and see. I think I''ve spotted something on my compilation of the new dll: all the states are slower than on the old except for _1S. I cant spot what it is about this function that makes it work as fast as the old dll, yet the rest dont. Could you post your compiled dll so I could try it on my machine, Quantum.

About the 24 bit colour - it defaults to 32 if 24 bit is not available. Were the colours screwed on your machine or something?

Thank you.
r.

"The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."
Game_Init starting
DDERR_UNSUPPORTED: Error in lpdd->SetDisplayMode
Error Code: (16385). Error in lpdd->SetDisplayMode
Setting up variables for 24 bit.
RBitMask = 16711680, GBitMask = 65280, BBitMask = 255

That''s whats in the log file. I''m testing out this other DLL now..
Yep, you''re right, the new DLL is much slower when in any mode apart from 1S. I have no idea what could be causing it.
Very strange. I removed the pow() (replaced with the equivilant without using pow), and it worked faster than the old DLL!
Advertisement
So you suggest replacing every instance of pow(g,2) with g*g? Which particular state did you try this in? Or did it work for all?

One thing I do in all other modes than 1S is set some constant into a variable (which could easily be set as a #define constant): eg. float oneover32pi = 0.00994718f;. Is it possible msvc4 optimised this, but msvc6 doesn''t?

r.
Having replaced all the pow(f(x,y,z),2) with f(x)f(x), it (the new one runs almost as fast as the old one (still 100 ms slower). This begs to ask the question, how fast would it run if I had the old one optimised ?

Can some cool assembler guru look at it to see what''s going wrong?

"The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."

This topic is closed to new replies.

Advertisement