lithander wrote: ↑Wed Sep 15, 2021 2:36 am
If we wanted to make a fair comparison one should make an effort to implement exactly the same thing in C# and in C++ and compare that.
That's what i just told in the very first reply that i quoted you here.
One can compare a simple bitboard representation, then do some bitwise operations inside a for loop that runs for a considerable numbers of iterations, then you can test the difference
the same algorithm, the same code, no allocations or something else, just doing some operations with some ulong[] arrays in the C# side and some U64 arrays in in the C++ side, and you will see.
In my experience in C# ( . net framework 4.6.1 ) even doing bitwise operations just like the algorithm that appears in chessprogramming wiki:
https://www.chessprogramming.org/Square ... all_Pieces
That thing is very slow in C# at least in the C# that i'm running, you can't call that thing ~6M of times because it will be a very big slowdown. in C++ that should be really fast as you are just doing bitwise operation that are known to be super fast instructions
I don't know if in the . net that you are using that stuff is now very native instructions or much more optimized
one thing that i've noticed is that these engines in . net 5 , the binaries are worth of 10 mb in file size while the binaries that is built from Visual Studio in . net 4 are just 60kb