diff --git a/csharp-algorithms/HeapSort/HeapSort/HeapSort.csproj b/csharp-algorithms/HeapSort/HeapSort/HeapSort.csproj
index 6103222f24..c96a8eb1e7 100644
--- a/csharp-algorithms/HeapSort/HeapSort/HeapSort.csproj
+++ b/csharp-algorithms/HeapSort/HeapSort/HeapSort.csproj
@@ -2,13 +2,13 @@
Exe
- net6.0
+ net10.0
enable
enable
-
+
diff --git a/csharp-algorithms/HeapSort/HeapSort/HeapSortBenchmarks.cs b/csharp-algorithms/HeapSort/HeapSort/HeapSortBenchmarks.cs
new file mode 100644
index 0000000000..367751dbb3
--- /dev/null
+++ b/csharp-algorithms/HeapSort/HeapSort/HeapSortBenchmarks.cs
@@ -0,0 +1,35 @@
+using BenchmarkDotNet.Attributes;
+
+namespace HeapSort;
+
+public class HeapSortBenchmarks
+{
+ private const int Size = 2_000_000;
+
+ private readonly HeapSortMethods _heapSort = new();
+ private int[] _source = [];
+ private int[] _work = [];
+
+ [Params("Random", "Sorted", "Identical")]
+ public string Input { get; set; } = "Random";
+
+ [GlobalSetup]
+ public void Setup()
+ {
+ _source = Input switch
+ {
+ "Sorted" => HeapSortMethods.CreateSortedArray(Size),
+ "Identical" => HeapSortMethods.CreateIdenticalArray(Size, 1, Size),
+ _ => HeapSortMethods.CreateRandomArray(Size, 1, Size)
+ };
+ _work = new int[Size];
+ }
+
+ [Benchmark]
+ public int[] SortArray()
+ {
+ _source.CopyTo(_work, 0);
+
+ return _heapSort.SortArray(_work, Size);
+ }
+}
diff --git a/csharp-algorithms/HeapSort/HeapSort/HeapSortMethods.cs b/csharp-algorithms/HeapSort/HeapSort/HeapSortMethods.cs
index 69aa92f9d9..40c7101b86 100644
--- a/csharp-algorithms/HeapSort/HeapSort/HeapSortMethods.cs
+++ b/csharp-algorithms/HeapSort/HeapSort/HeapSortMethods.cs
@@ -1,100 +1,88 @@
-using BenchmarkDotNet.Attributes;
+namespace HeapSort;
-namespace HeapSort
+public class HeapSortMethods
{
- public class HeapSortMethods
+ public int[] SortArray(int[] array, int size)
{
- public IEnumerable