How we measure

CloneBox.Benchmark compares CloneBox with widely used clone libraries (DeepCloner, FastDeepCloner, CloneExtensions, AnyClone) and, as contrast, Mapster, AutoMapper, and a Newtonsoft.Json round-trip. Each (library × scenario) runs in an isolated process so a stack overflow cannot take down the suite.

Four graphs:

#ScenarioWhat it checks
1simpleTyped POCO, primitives, list, nested child · 1,000,000 clones
2cyclic301 children in List/Array/Dictionary (int keys), byte[], SelfReference · 400 clones
3dynamicExpandoObject as root: typed class, nested Expando, Parent/Self cycles · 300,000 clones
4intoExpando → existing DTO: matching members, keep extra target fields, skip [DoNotClone] · 200,000 runs

Representative results

Release / net10.0 (times vary by machine):

Librarysimplecyclicdynamicinto
CloneBox0.35 µs0.33 ms1.92 µs0.91 µs4/4
DeepCloner0.20 µs0.37 ms1.18 µs—3/4
FastDeepCloner2.76 µs———1/4
CloneExtensions0.17 µs———1/4
AnyClone3.40 µs———1/4
Mapster0.36 µs———1/4
AutoMapper0.16 µs———1/4
Newtonsoft.Json2.31 µs———1/4

A time is only listed when the result passed the checks — — means the copy was wrong or the process crashed.

Reproduce with:

dotnet run --project CloneBox.Benchmark -c Release

Takeaway

DeepCloner is a solid same-type cloner and wins on simple graphs. Mappers and serializers were never meant to be cloners. CloneBox is the one that is correct on cycles, on dynamic objects, and on clone-into.

Full write-up: GitHub README.