Optimization for speed in VS 2008

Discussion of chess software programming and technical issues.

Moderator: Ras

Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: Optimization for speed in VS 2008

Post by Milos »

rbarreira wrote:He already said he wasn't happy with the improvement from things like PGO. Given that, I didn't think that he'd be happy with any other flags either.
And I already said that sometimes you get more from compiler flags than from PGO.
Engin
Posts: 1001
Joined: Mon Jan 05, 2009 7:40 pm
Location: Germany
Full name: Engin Üstün

Re: Optimization for speed in VS 2008

Post by Engin »

yes, you understand me :)

thx for your help, i will try what is different with yours and my
Engin
Posts: 1001
Joined: Mon Jan 05, 2009 7:40 pm
Location: Germany
Full name: Engin Üstün

Re: Optimization for speed in VS 2008

Post by Engin »

yes right, i know about that a better algorithm is by far the best way.

but why not get a increased speed more about 5-15 % too with fast compiler options :)

i am using a profiler too to see which functions takes much time and try this rewrite it better and faster, but sometimes there is no solution to make it faster.
Dann Corbit
Posts: 12803
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Optimization for speed in VS 2008

Post by Dann Corbit »

Engin wrote:yes right, i know about that a better algorithm is by far the best way.

but why not get a increased speed more about 5-15 % too with fast compiler options :)

i am using a profiler too to see which functions takes much time and try this rewrite it better and faster, but sometimes there is no solution to make it faster.
You could do worse than:

/Zi /nologo /Wall /WX- /Ox /Ob2 /Oi /Ot /Oy /GT /GL /GF /Gm- /MT /Zp16 /GS- /Gy /Gr /wd"4996"
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Optimization for speed in VS 2008

Post by bob »

Milos wrote:
bob wrote:Perhaps because compiler options (assuming basic optimizations are enabled) are not going to make a big difference, and he seems to be far slower than he expects. It's not a compiler issue.
Depends what you call a big difference. I have sometimes experienced 10-15% difference between the full optimization line and just /O2.
On many cases I don't get more than 5% with PGO.
So it's all relative.
And yes, I'm talking about VS2008.
I didn't get the impression he was looking for 10%.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Optimization for speed in VS 2008

Post by bob »

Milos wrote:
rbarreira wrote:He already said he wasn't happy with the improvement from things like PGO. Given that, I didn't think that he'd be happy with any other flags either.
And I already said that sometimes you get more from compiler flags than from PGO.
Been compiling a long time. Never seen a case where you use -O2 + PGO and then can find another 10-15% on top of that, except for cases where you can tell the compiler to use instructions specific to the processor you are using. And most compilers do that by default nowadays..
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: Optimization for speed in VS 2008

Post by Milos »

bob wrote:Been compiling a long time. Never seen a case where you use -O2 + PGO and then can find another 10-15% on top of that, except for cases where you can tell the compiler to use instructions specific to the processor you are using.
I was not saying that, I tried to say that -O2+PGO can be sometimes slower than just -O2 -XX (some other flags) without PGO.
When you add PGO on top of that you get more speedup (however, PGO brings then usually only few %).
rbarreira
Posts: 900
Joined: Tue Apr 27, 2010 3:48 pm

Re: Optimization for speed in VS 2008

Post by rbarreira »

And I already said that sometimes you get more from compiler flags than from PGO.
OK good for you. Now how does that give you the right to be an annoying prick who says others are preaching and not helping? :P

Honestly I didn't get the idea that he was asking only for compile flags in the OP.
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: Optimization for speed in VS 2008

Post by Milos »

rbarreira wrote:OK good for you. Now how does that give you the right to be an annoying prick who says others are preaching and not helping? :P

Honestly I didn't get the idea that he was asking only for compile flags in the OP.
And your idea about helping someone is to advice him the most banal thing like he's stupid or something.
It would help if you actually read what ppl write instead of only making arrogant assumptions.
rbarreira
Posts: 900
Joined: Tue Apr 27, 2010 3:48 pm

Re: Optimization for speed in VS 2008

Post by rbarreira »

Milos wrote:
rbarreira wrote:OK good for you. Now how does that give you the right to be an annoying prick who says others are preaching and not helping? :P

Honestly I didn't get the idea that he was asking only for compile flags in the OP.
And your idea about helping someone is to advice him the most banal thing like he's stupid or something.
It would help if you actually read what ppl write instead of only making arrogant assumptions.
My idea of helping someone is to give him the best advice I can. Which in this case, as he didn't appear to know why his code is slow, is to profile it and tell us the results so that we can help him further if he so wishes.

Fiddling with compiler options is not going to turn something "very slow" into something fast compared to "Crafty" (the OP's words, not mine).

So I gave the best advice I could considering the scarce information that the OP gave us about his engine. How is that being arrogant?