Optimization for speed in VS 2008

Discussion of chess software programming and technical issues.

Moderator: Ras

Dann Corbit
Posts: 12792
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:i done the same way, but i dont running so long time, after the optimization i get some errors, that i dont get if i compiled normal without PGO
Usually, that is the result of undefined behavior in the code.
Dann Corbit
Posts: 12792
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:are you suggest that this option is worse ? Ob2 too ?
Try them both with your code.
Dann Corbit
Posts: 12792
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Optimization for speed in VS 2008

Post by Dann Corbit »

Try menu option "Analze" option choice "Run Code Analysis"
Sometimes this will point out problems in the code.
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 »

i dont know where this option "analyse" is or this option did not exist on my compiler version.
Dann Corbit
Posts: 12792
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:i dont know where this option "analyse" is or this option did not exist on my compiler version.
That is a shame. Maybe it only comes in the expensive versions.
It is the most valuable feature of the new compiler, in my view.
User avatar
OliverUwira
Posts: 170
Joined: Mon Sep 13, 2010 9:57 am
Location: Frankfurt am Main

Re: Optimization for speed in VS 2008

Post by OliverUwira »

Dann Corbit wrote:
Engin wrote:i dont know where this option "analyse" is or this option did not exist on my compiler version.
That is a shame. Maybe it only comes in the expensive versions.
It is the most valuable feature of the new compiler, in my view.
Hmm, I have the feature, and I tried it with all warnings turned on. Zero warnings, so my code is plain and simply slow...

Also a really nice feature is the built-in profiler. :roll:

As for the incredible speed of Crafty. I have no idea as well how that works. Perhaps having only a single source file where includes are ordered according to their usage is making the difference there.
Dann Corbit
Posts: 12792
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Optimization for speed in VS 2008

Post by Dann Corbit »

OliverUwira wrote:
Dann Corbit wrote:
Engin wrote:i dont know where this option "analyse" is or this option did not exist on my compiler version.
That is a shame. Maybe it only comes in the expensive versions.
It is the most valuable feature of the new compiler, in my view.
Hmm, I have the feature, and I tried it with all warnings turned on. Zero warnings, so my code is plain and simply slow...

Also a really nice feature is the built-in profiler. :roll:

As for the incredible speed of Crafty. I have no idea as well how that works. Perhaps having only a single source file where includes are ordered according to their usage is making the difference there.
The single file idea gives 5% at most.

As for incredible speed, what is the thing that you marvel at?
Is it the perft?
Is it the search NPS?
User avatar
OliverUwira
Posts: 170
Joined: Mon Sep 13, 2010 9:57 am
Location: Frankfurt am Main

Re: Optimization for speed in VS 2008

Post by OliverUwira »

Dann Corbit wrote:
OliverUwira wrote:
Dann Corbit wrote:
Engin wrote:i dont know where this option "analyse" is or this option did not exist on my compiler version.
That is a shame. Maybe it only comes in the expensive versions.
It is the most valuable feature of the new compiler, in my view.
Hmm, I have the feature, and I tried it with all warnings turned on. Zero warnings, so my code is plain and simply slow...

Also a really nice feature is the built-in profiler. :roll:

As for the incredible speed of Crafty. I have no idea as well how that works. Perhaps having only a single source file where includes are ordered according to their usage is making the difference there.
The single file idea gives 5% at most.

As for incredible speed, what is the thing that you marvel at?
Is it the perft?
Is it the search NPS?
The search NPS is what amazes most, I think. On my x64 notebook Crafty 23.3 (JA) is 20-30% faster than Kurt (my compile, well well :roll:) . And I haven't even started to overhaul my evaluation, which will make it more heavy...

Bob must have squeezed _every_ unneccersary cycle out of his code...
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 »

that is exactly what i am not understand too, the search NPS of Crafty is very fast, if i look at old versions about 800 KNS normaly, now increased to a speed up of 3x times in 23.x

if i make perft tests i get only about 2x times faster then Tornado, i dont know what the security of the search of Crafty is, or do it count every bean or double count in his source as nodes ?

may be Bob had really good profiled his baby and removed or maked the source code much much better with small time use.

on Tornado takes many times the quick sorting of moves, i dont know how can make this more faster as now is.
Dann Corbit
Posts: 12792
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:that is exactly what i am not understand too, the search NPS of Crafty is very fast, if i look at old versions about 800 KNS normaly, now increased to a speed up of 3x times in 23.x

if i make perft tests i get only about 2x times faster then Tornado, i dont know what the security of the search of Crafty is, or do it count every bean or double count in his source as nodes ?

may be Bob had really good profiled his baby and removed or maked the source code much much better with small time use.

on Tornado takes many times the quick sorting of moves, i dont know how can make this more faster as now is.
Most programs have a different sort for the root nodes and arbitrary nodes later in the search.

The root nodes get a full and careful qsort(). The arbitrary nodes get a simplified partial sort.