Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append _Benchmark at the end of benchmark classes and files #584

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ d4c05906bb9129bc00c5f8d91d61dd49c446fd7d
403c9ee3ff5c23bb6564b27f9aeaa6960354bc10

# General formatting/cleaning commits
0c7a8ce29a88c182dd9db95fd6dffbf580a51ba2
0c7a8ce29a88c182dd9db95fd6dffbf580a51ba2

# Benchmark files rename
0ef149771cad8c69b3024273ec18c33d21fa571e
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

namespace Lynx.Benchmark;

public class And_Sum_Or : BaseBenchmark
public class And_Sum_Or_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using BenchmarkDotNet.Attributes;

namespace Lynx.Benchmark;
public class ArrayCopy : BaseBenchmark
public class ArrayCopy_Benchmark : BaseBenchmark
{
public static IEnumerable<ulong[]> Data => new List<ulong[]> {
new ulong[]{ 1, 2, 3 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

namespace Lynx.Benchmark;

public class BitBoard_Struct_ReadonlyStruct_Class_Record : BaseBenchmark
public class BitBoard_Struct_ReadonlyStruct_Class_Record_Benchmark : BaseBenchmark
{
private struct BitBoardOps
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
namespace Lynx.Benchmark;

[SimpleJob]
public class Branching : BaseBenchmark
public class Branching_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

namespace Lynx.Benchmark;

public class CheckmateDetectionLimits : BaseBenchmark
public class CheckmateDetectionLimits_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace Lynx.Benchmark;

public class CountBits : BaseBenchmark
public class CountBits_Benchmark : BaseBenchmark
{
public static IEnumerable<Position> Data => new[] {
new Position(Constants.InitialPositionFEN),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
using Lynx.UCI.Commands;

namespace Lynx.Benchmark;
public class DebugCommandBenchmark : BaseBenchmark
public class DebugCommand_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace Lynx.Benchmark;

public class DivideByHalf : BaseBenchmark
public class DivideByHalf_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
using System.Collections.Frozen;

namespace Lynx.Benchmark;
public class EnPassantCaptureSquares : BaseBenchmark
public class EnPassantCaptureSquares_Benchmark : BaseBenchmark
{
public static IEnumerable<BoardSquare> Data => new[] {
BoardSquare.a3, BoardSquare.c3, BoardSquare.e3, BoardSquare.g3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static int EncodeMoveInt(int sourceSquare, int targetSquare, int piece, i
}
}

public class EncodeMove : BaseBenchmark
public class EncodeMove_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace Lynx.Benchmark;

public class EnumCasting : BaseBenchmark
public class EnumCasting_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

namespace Lynx.Benchmark;

public class FENGeneration : BaseBenchmark
public class FENGeneration_Benchmark : BaseBenchmark
{
[Benchmark(Baseline = true)]
[ArgumentsSource(nameof(Data))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

namespace Lynx.Benchmark;

public class GetLS1BIndex : BaseBenchmark
public class GetLS1BIndex_Benchmark : BaseBenchmark
{
public static IEnumerable<Position> Data => new[] {
new Position(Constants.InitialPositionFEN),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

namespace Lynx.Benchmark;

public partial class GoCommandParsingAlternatives : BaseBenchmark
public partial class GoCommandParsingAlternatives_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[] {
"go infinite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace Lynx.Benchmark;

public partial class GoCommandParsing_GeneratedAttribute : BaseBenchmark
public partial class GoCommandParsing_GeneratedAttribute_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[] {
"go infinite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lynx.Benchmark;

public class InitializeBishopAndRookAttacks : BaseBenchmark
public class InitializeBishopAndRookAttacks_Benchmark : BaseBenchmark
{
[Benchmark(Baseline = true)]
public void CurrentApproach() => new CustomPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace Lynx.Benchmark;

public class IsSquareAttacked_local_vs_external : BaseBenchmark
public class IsSquareAttacked_local_vs_external_Benchmark : BaseBenchmark
{
private readonly Position[] _positions = new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace Lynx.Benchmark;

public class IsSquareAttacked_parallel : BaseBenchmark
public class IsSquareAttacked_parallel_Benchmark : BaseBenchmark
{
private readonly Position[] _positions = new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Lynx.Benchmark;

public class LocalVariableIn_vs_NoIn : BaseBenchmark
public class LocalVariableIn_vs_NoIn_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[] {
Constants.EmptyBoardFEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
using System.Runtime.CompilerServices;

namespace Lynx.Benchmark;
public class MakeUnmakeMove_implementation : BaseBenchmark
public class MakeUnmakeMove_implementation_Benchmark : BaseBenchmark
{
public static IEnumerable<(string, int)> Data => new[] {
(Constants.InitialPositionFEN, 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
using System.Runtime.CompilerServices;

namespace Lynx.Benchmark;
public class MakeUnmakeMove_integration : BaseBenchmark
public class MakeUnmakeMove_integration_Benchmark : BaseBenchmark
{
public static IEnumerable<(string, int)> Data => new[] {
(Constants.InitialPositionFEN, 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace Lynx.Benchmark;

public class MoveGeneratorArrayVsDictionary : BaseBenchmark
public class MoveGeneratorArrayVsDictionary_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

namespace Lynx.Benchmark;

public class MoveGeneratorParallel : BaseBenchmark
public class MoveGeneratorParallel_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace Lynx.Benchmark;

public class MutableReadonlyBitBoard : BaseBenchmark
public class MutableReadonlyBitBoard_Benchmark : BaseBenchmark
{
private struct Mutable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class OppositeSiteImplementations
public static readonly int[] Array = new[] { 1, 0 };
}

public class OppositeSide : BaseBenchmark
public class OppositeSide_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
using Lynx.Model;

namespace Lynx.Benchmark;
public class PEXTBenchmark : BaseBenchmark
public class PEXTBenchmark_Benchmark : BaseBenchmark
{
private readonly Position _position = new Position(Constants.TrickyTestPositionFEN);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*
*
*
* | Method | Mean | Error | StdDev | Ratio | Allocated |
* |------------ |---------:|---------:|---------:|------:|----------:|
* | Sum | 66.41 us | 0.277 us | 0.245 us | 1.00 | - |
* | ArrayAccess | 57.53 us | 0.546 us | 0.456 us | 0.87 | - |
*
*
* | Method | Mean | Error | StdDev | Ratio | Allocated |
* |------------ |---------:|---------:|---------:|------:|----------:|
* | Sum | 66.49 us | 0.235 us | 0.219 us | 1.00 | - |
* | ArrayAccess | 58.05 us | 0.470 us | 0.392 us | 0.87 | - |
*
*
*
*
* C.Sum()
* L0000: push ebp
* L0001: mov ebp, esp
Expand All @@ -24,7 +24,7 @@
* L0016: jl short L0007
* L0018: pop ebp
* L0019: ret
*
*
* C.ArrayAccess()
* L0000: push ebp
* L0001: mov ebp, esp
Expand Down Expand Up @@ -56,11 +56,11 @@

namespace Lynx.Benchmark;

public class PVTable_SumVsArrayAccess : BaseBenchmark
public class PVTable_SumVsArrayAccess_Benchmark : BaseBenchmark
{
private const int MaxDepth = 64;

public PVTable_SumVsArrayAccess()
public PVTable_SumVsArrayAccess_Benchmark()
{
_ = PVTable.Indexes[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
int HalfMoveClock, int FullMoveCounter);

namespace Lynx.Benchmark;
public partial class ParseFENBenchmark : BaseBenchmark
public partial class ParseFENBenchmark_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[] {
Constants.InitialPositionFEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
using System.Text.RegularExpressions;

namespace Lynx.Benchmark;
public partial class ParseGameBenchmark : BaseBenchmark
public partial class ParseGame_Benchmark : BaseBenchmark
{
public static IEnumerable<string> Data => new[] {
"position startpos", // No moves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lynx.Benchmark;

public class PawnAttacks : BaseBenchmark
public class PawnAttacks_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 64, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Lynx.Benchmark;

#pragma warning disable RCS1058, IDE0054 // Use compound assignment

public class PieceAtSquare : BaseBenchmark
public class PieceAtSquare_Benchmark : BaseBenchmark
{
[Benchmark(Baseline = true)]
public int KnowingColor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static class PieceOffsetByBooleanImplementations
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int Branchless(bool isWhite) => 6 - (6 * Unsafe.As<bool, byte>(ref isWhite));
}
public class PieceOffset_Boolean : BaseBenchmark

public class PieceOffset_Boolean_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static class PieceOffsetBySideImplementations
public static readonly int[] Array = new[] { 6, 0 };
}

public class PieceOffset_Side : BaseBenchmark
public class PieceOffset_Side_Benchmark : BaseBenchmark
{
public static IEnumerable<int> Data => new[] { 1, 10, 1_000, 10_000, 100_000 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
using Lynx.Model;

namespace Lynx.Benchmark;
public class Piece_IsPawnBishopOrQueen : BaseBenchmark
public class Piece_IsPawnBishopOrQueen_Benchmark : BaseBenchmark
{
public static IEnumerable<Piece> Data => new[] {
Piece.P, Piece.p,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using Lynx.Model;

namespace Lynx.Benchmark;
public class PopulateOcurriencies : BaseBenchmark
public class PopulateOcurriencies_Benchmark : BaseBenchmark
{
public static IEnumerable<Position> Positions => new Position[] {
new(Constants.InitialPositionFEN),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace Lynx.Benchmark;

public class PositionClone : BaseBenchmark
public class PositionClone_Benchmark : BaseBenchmark
{
public readonly struct Position
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace Lynx.Benchmark;

public class PositionIdGeneration : BaseBenchmark
public class PositionIdGeneration_Benchmark : BaseBenchmark
{
[Benchmark(Baseline = true)]
[ArgumentsSource(nameof(Data))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Lynx.Benchmark;

public class PriorityQueue_Dequeue : BaseBenchmark
public class PriorityQueue_Dequeue_Benchmark : BaseBenchmark
{
[Params(10, 100, 1_000, 1_000_000)]
public int Size { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Lynx.Benchmark;

public class PriorityQueue_EnqueueRange : BaseBenchmark
public class PriorityQueue_EnqueueRange_Benchmark : BaseBenchmark
{
private const int Priority = 1_1111_111;

Expand Down
Loading
Loading