Sabrina profiling

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Sabrina profiling

Post by stegemma »

Here's the last profiling for Sabrina:

Code: Select all

Evaluate: 44.93%
MakeMoves: 25.17%
Executemove: 14.56%
IsInCheck: 1.94%
It is your engine giving similar result?
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
cetormenter
Posts: 170
Joined: Sun Oct 28, 2012 9:46 pm

Re: Sabrina profiling

Post by cetormenter »

I am assuming you mean generate moves when you say "makeMoves",

In Nirvana,

Evaluate: 35%
Generate moves (includes sorting): 18%
Making and unmaking moves: 6%
Is checking: 5%

The other large time sinks are ttProbes and see, which take 7% and 5% respectively.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Sabrina profiling

Post by stegemma »

With TT enabled, I'll get a result more similar to your:

Code: Select all

Evaluate: 36.35%
MakeMoves: 21.76%
ExecuteMove: 12.47%
IsInCheck: 1.61%
It seems that my ExecuteMove is slower than your but maybe is just because I haven't any kind of pruning (only "pure" alfabeta).

My IsInCheck requires less time but I've worked a lot to avoid this check-test any time that isn't required.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
cetormenter
Posts: 170
Joined: Sun Oct 28, 2012 9:46 pm

Re: Sabrina profiling

Post by cetormenter »

Remember that these numbers are only relative to the total CPU time of your program. If I wrote each method twice as efficiently I would get the same numbers as I do now.
AndrewGrant
Posts: 1750
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Sabrina profiling

Post by AndrewGrant »

Code: Select all

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 13.16      2.42     2.42 55557110     0.00     0.00  selectNextMove
  8.21      3.93     1.51 33204726     0.00     0.00  applyNormalMove
  7.37      5.29     1.36 36844190     0.00     0.00  evaluateRooks
  5.93      6.38     1.09 54841283     0.00     0.00  squareIsAttacked
  5.93      7.47     1.09 36844190     0.00     0.00  evaluateBishops
  5.38      8.46     0.99 12214495     0.00     0.00  genAllNoisyMoves
  4.49      9.28     0.83 36844190     0.00     0.00  evaluateQueens
  4.32     10.08     0.80      518     0.00     0.03  search
  4.21     10.85     0.78 63779288     0.00     0.00  getHistoryScore
  4.13     11.61     0.76 36844190     0.00     0.00  evaluateKnights
  3.54     12.26     0.65 236173712     0.00     0.00  popcount
  3.34     12.88     0.62 33574689     0.00     0.00  revertMove
  3.05     13.44     0.56 18422095     0.00     0.00  initializeEvalInfo
  2.28     13.86     0.42  6285531     0.00     0.00  qsearch
  1.96     14.22     0.36 36844190     0.00     0.00  evaluatePawns
  1.90     14.57     0.35  6235641     0.00     0.00  getTranspositionEntry
  1.79     14.90     0.33 36844190     0.00     0.00  evaluatePassedPawns
  1.77     15.22     0.33 18427499     0.00     0.00  evaluateBoard
  1.74     15.54     0.32 36844190     0.00     0.00  evaluateKings
  1.69     15.85     0.31 12214495     0.00     0.00  evaluateNoisyMoves
  1.69     16.16     0.31       36     0.01     0.01  clearTranspositionTable
  1.63     16.46     0.30 18422095     0.00     0.00  evaluatePieces
  1.63     16.76     0.30  1288059     0.00     0.00  genAllQuietMoves
  1.52     17.04     0.28 33574689     0.00     0.00  applyMove
  1.31     17.28     0.24 54771801     0.00     0.00  isNotInCheck
  1.31     17.52     0.24  1288059     0.00     0.00  evaluateQuietMoves
  1.03     17.71     0.19 38926968     0.00     0.00  moveIsTactical
Here are the big time users from Ethereal. Our ExecuteMove times are about the same.
squareIsAttacked is about the same as isInCheck, so 6% here.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Sabrina profiling

Post by jdart »

I haven't done profiling for a while.

It is normal for eval to be the biggest component.

Your generate move/make move numbers look high to me. Do you do incremental make/unmake or copy/make?

--Jon
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Sabrina profiling

Post by stegemma »

jdart wrote:I haven't done profiling for a while.

It is normal for eval to be the biggest component.

Your generate move/make move numbers look high to me. Do you do incremental make/unmake or copy/make?

--Jon
Actually I use copy/make but I don't use standard bitboards. I must investigate, because I get a very high nps but a very poor ELO.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Sabrina profiling

Post by cdani »

Andscacs in big numbers: 42.4% eval, 57.6% the rest.
Some functions:
* make/unmake moves/nulls: 6%
* calc attacks: 4.4%
* see: 2.66%
* save/load hash: 5.3%
* move is check: 2.63%
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Sabrina profiling

Post by Henk »

stegemma wrote: but I don't use standard bitboards.
The more complexity the more misery
AndrewGrant
Posts: 1750
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Sabrina profiling

Post by AndrewGrant »

Still looking forward to seeing the simplicity you have added into Skipper.

Perhaps one day you'll share your knowledge with us.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )