Skip to content

Commit 05a9717

Browse files
committed
optimize reflection-based cloning
1 parent e96ca54 commit 05a9717

File tree

9 files changed

+838
-193
lines changed

9 files changed

+838
-193
lines changed

src/FastCloner.Benchmark/BenchDynamic.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Setup()
3636
public object FastCloner_Simple() => FastCloner.DeepClone(_simple);
3737
3838
[Benchmark(Baseline = true), BenchmarkCategory("Simple")]
39-
public object? DeepCloner_Simple() => _simple.DeepClone();
39+
public object? DeepCloner_Simple() => _simple.DeepClone();*/
4040

4141
// Nested ExpandoObject
4242
[Benchmark, BenchmarkCategory("Nested")]
@@ -71,7 +71,7 @@ public void Setup()
7171
public object? FastCloner_Mixed() => FastCloner.DeepClone(_mixed);
7272

7373
[Benchmark(Baseline = true), BenchmarkCategory("Mixed")]
74-
public object? DeepCloner_Mixed() => _mixed.DeepClone();*/
74+
public object? DeepCloner_Mixed() => _mixed.DeepClone();
7575

7676
// Large ExpandoObject (100 properties)
7777
[Benchmark, BenchmarkCategory("Large")]
@@ -232,7 +232,7 @@ private static dynamic CreateLargeExpando(int propertyCount)
232232
{
233233
NestedId = i,
234234
NestedValue = $"Nested {i}"
235-
};;
235+
};
236236
break;
237237
}
238238
}

src/FastCloner.Profiling/LargeExpandoProfiler.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ public static void Run(string[] args)
4949

5050
if (interactive)
5151
{
52-
Console.WriteLine(">>> ATTACH YOUR PROFILER NOW <<<");
53-
Console.WriteLine("Suggested focus:");
54-
Console.WriteLine(" - GenerateExpandoObjectCopyLoop");
55-
Console.WriteLine(" - CloneClassInternal");
56-
Console.WriteLine(" - IsTypeIgnoredMethodInfo calls");
57-
Console.WriteLine(" - GetType() calls in the loop");
58-
Console.WriteLine();
52+
Console.WriteLine(">>> ATTACH PROFILER NOW <<<");
5953
Console.WriteLine("Press any key to start profiling...");
6054
Console.ReadKey(true);
6155
Console.WriteLine();

0 commit comments

Comments
 (0)