This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics; | |
| using System.Diagnostics.CodeAnalysis; | |
| int capacity = 10_000_000; | |
| List<Vector3NoEquals> Vector3NoEquals = new(capacity); | |
| List<Vector3WithEquals> Vector3GoodEquals = new(capacity); | |
| List<Vector3WithIEquality> Vector3WithIEquality = new(capacity); | |
| for (int i = 0; i < capacity; i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Console.WriteLine("Creating 50 NotDisposable objects which will" + | |
| " allocate 500mb of memory and will not clean at garbage collection."); | |
| Console.ReadLine(); | |
| if(true) | |
| { | |
| NotDisposableContainer container = new NotDisposableContainer(); | |
| container.ND = new List<NotDisposable>(); | |
| for (int i = 0; i < 50; i++) | |
| container.ND.Add(new NotDisposable()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| int iterations = 1_000_000; | |
| List<ReflectionComparison> comparisons1 = new List<ReflectionComparison>(); | |
| List<ReflectionComparison> comparisons2 = new List<ReflectionComparison>(); | |
| List<ByteComparison> comparisons3 = new List<ByteComparison>(); | |
| List<ByteComparison> comparisons4 = new List<ByteComparison>(); | |
| List<ReferenceType> comparisons5 = new List<ReferenceType>(); |
NewerOlder