MarcinJuraszek / CloneExtensions

Clone extension method library. Performs fast, deep or shallow clone using simple assignment operations generated by Expression Tree runtime code compilation.
Apache License 2.0
115 stars 30 forks source link

Very simple and primitive benchmarking using BenchmarkDotNet #23

Closed MarcinJuraszek closed 7 years ago

MarcinJuraszek commented 7 years ago

Just benchmarks CloneExtensions. No comparison with other solutions (hand-crafted code, BinarySerializer, JsonConvert, MemberwiseClone, etc.). That will have to be in a separate change.

Sample results:

                                      Method |           Mean |         Error |        StdDev |
-------------------------------------------- |---------------:|--------------:|--------------:|
                         GetCloneSimpleClass |       251.9 ns |      4.982 ns |      4.661 ns |
                          GetCloneListOfInts |     4,592.5 ns |     49.553 ns |     43.928 ns |
       GetCloneListOfSimpleClassSameInstance |   934,753.9 ns |  5,213.563 ns |  4,070.407 ns |
 GetCloneListOfSimpleClassDifferentInstances | 3,237,656.6 ns | 40,894.748 ns | 36,252.126 ns |