From 139ff7f33016e42d75f43d0300e4e4c8fec55ee6 Mon Sep 17 00:00:00 2001 From: Antoine Aubry Date: Mon, 21 Sep 2020 15:48:00 +0100 Subject: [PATCH 1/3] Improve the performance of InsertionQueue --- YamlDotNet.Test/Core/InsertionQueueTests.cs | 146 ++++++++++++++++++- YamlDotNet.Test/YamlDotNet.Test.csproj | 1 + YamlDotNet/Core/InsertionQueue.cs | 147 ++++++++++++++++++-- YamlDotNet/Helpers/NumberExtensions.cs | 10 ++ 4 files changed, 289 insertions(+), 15 deletions(-) create mode 100644 YamlDotNet/Helpers/NumberExtensions.cs diff --git a/YamlDotNet.Test/Core/InsertionQueueTests.cs b/YamlDotNet.Test/Core/InsertionQueueTests.cs index caa4441d7..64b1081f1 100644 --- a/YamlDotNet.Test/Core/InsertionQueueTests.cs +++ b/YamlDotNet.Test/Core/InsertionQueueTests.cs @@ -24,12 +24,156 @@ using System.Linq; using FluentAssertions; using Xunit; +using Xunit.Abstractions; using YamlDotNet.Core; namespace YamlDotNet.Test.Core { public class InsertionQueueTests { + private readonly ITestOutputHelper output; + + public InsertionQueueTests(ITestOutputHelper output) + { + this.output = output; + } + + [Theory] + [InlineData("-43210--", 0, "-43210X-")] + [InlineData("---43210", 0, "X--43210")] + [InlineData("10---432", 0, "10X--432")] + + [InlineData("--43210-", 5, "-X43210-")] + [InlineData("43210---", 5, "43210--X")] + [InlineData("210---43", 5, "210--X43")] + + [InlineData("-43210--", 2, "-432X10-")] + [InlineData("---43210", 2, "--432X10")] + [InlineData("43210---", 2, "432X10--")] + [InlineData("210---43", 2, "2X10--43")] + [InlineData("10---432", 2, "10--432X")] + public void CalculateInsertionParameters_is_correct(string initialState, int index, string expectedFinalState) + { + static (int capacity, int readPtr, int writePtr, int insertPtr, List<(char chr, int idx)> elements) ParseState(string state) + { + var chars = state.ToArray() + .Select((chr, idx) => (chr, idx)) + .ToList(); + + var elements = chars + .Where(e => e.chr != '-') + .ToList(); + + var insertPtr = chars + .Where(e => e.chr == 'X') + .Select(e => e.idx) + .FirstOrDefault(); + + var readPtr = chars + .SkipWhile(e => e.chr == '-') + .TakeWhile(e => e.chr != '-') + .Last() + .idx; + + var writePtr = chars + .SkipWhile(e => e.chr != '-') + .TakeWhile(e => e.chr == '-') + .Last() + .idx; + + return (state.Length, readPtr, writePtr, insertPtr, elements); + } + + var (capacity, readPtr, writePtr, _, initialElements) = ParseState(initialState); + var (finalCapacity, expectedReadPtr, expectedWritePtr, expectedInsertPtr, finalElements) = ParseState(expectedFinalState); + + if (capacity != finalCapacity) + { + throw new InvalidOperationException($"Invalid test data: capacity: {capacity}, finalCapacity: {finalCapacity}"); + } + + var capacityIsPowerOf2 = + (int)(Math.Ceiling((Math.Log(capacity) / Math.Log(2)))) == + (int)(Math.Floor(((Math.Log(capacity) / Math.Log(2))))); + + if (!capacityIsPowerOf2) + { + throw new InvalidOperationException($"Capacity should be a power of 2, but was {capacity}."); + } + + output.WriteLine("Initial State"); + output.WriteLine("============="); + output.WriteLine(""); + PrintChars((readPtr, 'R'), (writePtr, 'W')); + output.WriteLine(initialState); + output.WriteLine(""); + + output.WriteLine("Expected Final State"); + output.WriteLine("===================="); + output.WriteLine(""); + PrintChars((expectedReadPtr, 'R'), (expectedWritePtr, 'W')); + output.WriteLine(expectedFinalState); + PrintChars((expectedInsertPtr, '^')); + output.WriteLine(""); + + var movedElements = initialElements + .Join(finalElements, e => e.chr, e => e.chr, (i, f) => (i.chr, from: i.idx, offset: f.idx - i.idx)) + .Where(c => c.offset != 0) + .ToList(); + + int expectedCopyIndex, expectedCopyOffset, expectedCopyLength; + if (movedElements.Count != 0) + { + if (movedElements.Select(e => e.offset).Distinct().Count() != 1) + { + throw new InvalidOperationException("Invalid test data"); + } + + expectedCopyIndex = movedElements.Select(e => e.from).Min(); + expectedCopyOffset = movedElements[0].offset; + expectedCopyLength = movedElements.Count; + } + else + { + expectedCopyIndex = 0; + expectedCopyOffset = 0; + expectedCopyLength = 0; + } + + var mask = capacity - 1; // Assuming that capacity is a power of 2 + + InsertionQueue.CalculateInsertionParameters(mask, initialElements.Count, index, ref readPtr, ref writePtr, out var insertPtr, out var copyIndex, out var copyOffset, out var copyLength); + + static string Format(int readPtr, int writePtr, int insertPtr, int copyIndex, int copyOffset, int copyLength) + { + return $"readPtr: {readPtr}, writePtr: {writePtr}, insertPtr: {insertPtr}, copyIndex: {copyIndex}, copyOffset: {copyOffset}, copyLength: {copyLength}"; + } + + var expected = Format(expectedReadPtr, expectedWritePtr, expectedInsertPtr, expectedCopyIndex, expectedCopyOffset, expectedCopyLength); + var actual = Format(readPtr, writePtr, insertPtr, copyIndex, copyOffset, copyLength); + + output.WriteLine($"expected: {expected}"); + output.WriteLine($"actual: {actual}"); + + Assert.Equal(expected, actual); + } + + private void PrintChars(params (int idx, char chr)[] characters) + { + var text = new char[characters.Max(c => c.idx) + 1]; + for (int i = 0; i < text.Length; ++i) + { + text[i] = ' '; + } + + foreach (var (idx, chr) in characters) + { + text[idx] = chr; + } + + output.WriteLine(new string(text)); + } + [Fact] public void ShouldThrowExceptionWhenDequeuingEmptyContainer() { @@ -100,7 +244,7 @@ public void ShouldCorrectlyDequeueElementsWhenInserting() private static InsertionQueue CreateQueue() { - return new InsertionQueue(); + return new InsertionQueue(1); } private IEnumerable WithTheRange(int from, int to) diff --git a/YamlDotNet.Test/YamlDotNet.Test.csproj b/YamlDotNet.Test/YamlDotNet.Test.csproj index aa18e8bc9..b569c2474 100644 --- a/YamlDotNet.Test/YamlDotNet.Test.csproj +++ b/YamlDotNet.Test/YamlDotNet.Test.csproj @@ -4,6 +4,7 @@ false ..\YamlDotNet.snk true + 8.0 diff --git a/YamlDotNet/Core/InsertionQueue.cs b/YamlDotNet/Core/InsertionQueue.cs index abded8aff..619a2ccda 100644 --- a/YamlDotNet/Core/InsertionQueue.cs +++ b/YamlDotNet/Core/InsertionQueue.cs @@ -20,7 +20,8 @@ // SOFTWARE. using System; -using System.Collections.Generic; +using System.Diagnostics; +using YamlDotNet.Helpers; namespace YamlDotNet.Core { @@ -30,28 +31,49 @@ namespace YamlDotNet.Core [Serializable] public sealed class InsertionQueue { - // TODO: Use a more efficient data structure + private const int DefaultInitialCapacity = 1 << 7; // Must be a power of 2 - private readonly IList items = new List(); + // Circular buffer + private T[] items; + private int readPtr; + private int writePtr; + private int mask; + private int count = 0; - /// - /// Gets the number of items that are contained by the queue. - /// - public int Count + public InsertionQueue(int initialCapacity = DefaultInitialCapacity) { - get + if (initialCapacity <= 0) + { + throw new ArgumentOutOfRangeException(nameof(initialCapacity), "The initial capacity must be a positive number."); + } + + if (!initialCapacity.IsPowerOfTwo()) { - return items.Count; + throw new ArgumentException("The initial capacity must be a power of 2.", nameof(initialCapacity)); } + + items = new T[initialCapacity]; + readPtr = initialCapacity / 2; + writePtr = initialCapacity / 2; + mask = initialCapacity - 1; } + /// + /// Gets the number of items that are contained by the queue. + /// + public int Count => count; + /// /// Enqueues the specified item. /// /// The item to be enqueued. public void Enqueue(T item) { - items.Add(item); + ResizeIfNeeded(); + + items[writePtr] = item; + writePtr = (writePtr - 1) & mask; + ++count; } /// @@ -60,13 +82,14 @@ public void Enqueue(T item) /// Returns the item that been dequeued. public T Dequeue() { - if (Count == 0) + if (count == 0) { throw new InvalidOperationException("The queue is empty"); } - T item = items[0]; - items.RemoveAt(0); + var item = items[readPtr]; + readPtr = (readPtr - 1) & mask; + --count; return item; } @@ -77,7 +100,103 @@ public T Dequeue() /// The item to be inserted. public void Insert(int index, T item) { - items.Insert(index, item); + if (index > count) + { + throw new InvalidOperationException("Cannot insert outside of the bounds of the queue"); + } + + ResizeIfNeeded(); + + CalculateInsertionParameters( + mask, count, index, + ref readPtr, ref writePtr, + out var insertPtr, + out var copyIndex, out var copyOffset, out var copyLength + ); + + if (copyLength != 0) + { + Array.Copy(items, copyIndex, items, copyIndex + copyOffset, copyLength); + } + + items[insertPtr] = item; + ++count; + } + + private void ResizeIfNeeded() + { + var capacity = items.Length; + if (count == capacity) + { + Debug.Assert(readPtr == writePtr); + + var newItems = new T[capacity * 2]; + + var beginCount = readPtr; + if (beginCount > 0) + { + Array.Copy(items, 0, newItems, 0, readPtr); + } + + writePtr += capacity; + var endCount = capacity - readPtr - 1; + if (endCount > 0) + { + Array.Copy(items, readPtr + 1, newItems, writePtr + 1, endCount); + } + + items = newItems; + mask = mask * 2 + 1; + } + } + + internal static void CalculateInsertionParameters(int mask, int count, int index, ref int readPtr, ref int writePtr, out int insertPtr, out int copyIndex, out int copyOffset, out int copyLength) + { + var indexOfLastElement = (readPtr + 1) & mask; + if (index == 0) + { + insertPtr = readPtr = indexOfLastElement; + + // No copy is needed + copyIndex = 0; + copyOffset = 0; + copyLength = 0; + return; + } + + insertPtr = (readPtr - index) & mask; + if (index == count) + { + writePtr = (writePtr - 1) & mask; + + // No copy is needed + copyIndex = 0; + copyOffset = 0; + copyLength = 0; + return; + } + + var canMoveRight = indexOfLastElement >= insertPtr; + var moveRightCost = canMoveRight ? readPtr - insertPtr : int.MaxValue; + + var canMoveLeft = writePtr <= insertPtr; + var moveLeftCost = canMoveLeft ? insertPtr - writePtr : int.MaxValue; + + if (moveRightCost <= moveLeftCost) + { + ++insertPtr; + ++readPtr; + copyIndex = insertPtr; + copyOffset = 1; + copyLength = moveRightCost; + } + else + { + copyIndex = writePtr + 1; + copyOffset = -1; + copyLength = moveLeftCost; + --writePtr; + } } } } \ No newline at end of file diff --git a/YamlDotNet/Helpers/NumberExtensions.cs b/YamlDotNet/Helpers/NumberExtensions.cs new file mode 100644 index 000000000..0632ca631 --- /dev/null +++ b/YamlDotNet/Helpers/NumberExtensions.cs @@ -0,0 +1,10 @@ +namespace YamlDotNet.Helpers +{ + internal static class NumberExtensions + { + public static bool IsPowerOfTwo(this int value) + { + return (value & (value - 1)) == 0; + } + } +} From a8b044d9896f23aea9e85cc01cf23b55d11eb824 Mon Sep 17 00:00:00 2001 From: Antoine Aubry Date: Mon, 21 Sep 2020 15:48:30 +0100 Subject: [PATCH 2/3] Improve the performance of LookAheadBuffer --- YamlDotNet.Test/Core/LookAheadBufferTests.cs | 91 +++----------------- YamlDotNet/Core/LookAheadBuffer.cs | 60 +++++++------ YamlDotNet/Core/Scanner.cs | 2 +- 3 files changed, 49 insertions(+), 104 deletions(-) diff --git a/YamlDotNet.Test/Core/LookAheadBufferTests.cs b/YamlDotNet.Test/Core/LookAheadBufferTests.cs index 8fb2b5d9f..58680fec1 100644 --- a/YamlDotNet.Test/Core/LookAheadBufferTests.cs +++ b/YamlDotNet.Test/Core/LookAheadBufferTests.cs @@ -36,118 +36,91 @@ public class LookAheadBufferTests [Fact] public void ShouldHaveReadOnceWhenPeekingAtOffsetZero() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(0).Should().Be('a'); - A.CallTo(() => reader.Read()).MustHaveHappened(Repeated.Exactly.Once); } [Fact] public void ShouldHaveReadTwiceWhenPeekingAtOffsetOne() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(0); buffer.Peek(1).Should().Be('b'); - A.CallTo(() => reader.Read()).MustHaveHappened(Repeated.Exactly.Twice); } [Fact] public void ShouldHaveReadThriceWhenPeekingAtOffsetTwo() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(0); buffer.Peek(1); buffer.Peek(2).Should().Be('c'); - A.CallTo(() => reader.Read()).MustHaveHappened(Repeated.Exactly.Times(3)); } [Fact] public void ShouldNotHaveReadAfterSkippingOneCharacter() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(() => { ++reads; }); - buffer.Skip(1); buffer.Peek(0).Should().Be('b'); buffer.Peek(1).Should().Be('c'); - - Assert.Equal(0, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingOneCharacter() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(1); buffer.Peek(2).Should().Be('d'); - - Assert.Equal(1, reads); } [Fact] public void ShouldHaveReadTwiceAfterSkippingOneCharacter() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(1); buffer.Peek(3).Should().Be('e'); - - Assert.Equal(2, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingFiveCharacters() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); buffer.Skip(1); buffer.Peek(3); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(4); buffer.Peek(0).Should().Be('f'); - - Assert.Equal(1, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingSixCharacters() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); @@ -156,20 +129,14 @@ public void ShouldHaveReadOnceAfterSkippingSixCharacters() buffer.Skip(4); buffer.Peek(0); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(1); buffer.Peek(0).Should().Be('g'); - - Assert.Equal(1, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingSevenCharacters() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); @@ -178,20 +145,14 @@ public void ShouldHaveReadOnceAfterSkippingSevenCharacters() buffer.Skip(4); buffer.Peek(1); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(2); buffer.Peek(0).Should().Be('h'); - - Assert.Equal(1, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingEightCharacters() { - var innerReader = new StringReader(TestString); - var reader = A.Fake(x => x.Wrapping(innerReader)); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); @@ -200,19 +161,14 @@ public void ShouldHaveReadOnceAfterSkippingEightCharacters() buffer.Skip(4); buffer.Peek(2); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(call => { ++reads; }).ReturnsLazily(call => innerReader.Read()); - buffer.Skip(3); buffer.Peek(0).Should().Be('i'); - - Assert.Equal(1, reads); } [Fact] public void ShouldHaveReadOnceAfterSkippingNineCharacters() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); @@ -221,19 +177,14 @@ public void ShouldHaveReadOnceAfterSkippingNineCharacters() buffer.Skip(4); buffer.Peek(3); - int reads = 0; - A.CallTo(() => reader.Read()).Invokes(() => { ++reads; }); - buffer.Skip(4); buffer.Peek(0).Should().Be('\0'); - - Assert.Equal(1, reads); } [Fact] public void ShouldFindEndOfInput() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(2); @@ -247,21 +198,10 @@ public void ShouldFindEndOfInput() buffer.EndOfInput.Should().BeTrue(); } - [Fact] - public void ShouldThrowWhenPeekingBeyondCapacity() - { - var reader = CreateFakeReader(TestString); - var buffer = CreateBuffer(reader, Capacity); - - Action action = () => buffer.Peek(4); - - action.ShouldThrow(); - } - [Fact] public void ShouldThrowWhenSkippingBeyondCurrentBuffer() { - var reader = CreateFakeReader(TestString); + var reader = new StringReader(TestString); var buffer = CreateBuffer(reader, Capacity); buffer.Peek(3); @@ -270,11 +210,6 @@ public void ShouldThrowWhenSkippingBeyondCurrentBuffer() action.ShouldThrow(); } - private static TextReader CreateFakeReader(string text) - { - return A.Fake(x => x.Wrapping(new StringReader(text))); - } - private static LookAheadBuffer CreateBuffer(TextReader reader, int capacity) { return new LookAheadBuffer(reader, capacity); diff --git a/YamlDotNet/Core/LookAheadBuffer.cs b/YamlDotNet/Core/LookAheadBuffer.cs index 440484f30..1185215aa 100644 --- a/YamlDotNet/Core/LookAheadBuffer.cs +++ b/YamlDotNet/Core/LookAheadBuffer.cs @@ -21,6 +21,7 @@ using System; using System.IO; +using YamlDotNet.Helpers; namespace YamlDotNet.Core { @@ -36,7 +37,10 @@ public sealed class LookAheadBuffer : ILookAheadBuffer { private readonly TextReader input; private readonly char[] buffer; + private readonly int blockSize; + private readonly int mask; private int firstIndex; + private int writeOffset; private int count; private bool endOfInput; @@ -52,8 +56,18 @@ public LookAheadBuffer(TextReader input, int capacity) throw new ArgumentOutOfRangeException(nameof(capacity), "The capacity must be positive."); } + if (!capacity.IsPowerOfTwo()) + { + throw new ArgumentException("The capacity must be a power of 2.", nameof(capacity)); + } + this.input = input ?? throw new ArgumentNullException(nameof(input)); - buffer = new char[capacity]; + + blockSize = capacity; + + // Allocate twice the required capacity to ensure that + buffer = new char[capacity * 2]; + mask = capacity * 2 - 1; } /// @@ -66,12 +80,7 @@ public LookAheadBuffer(TextReader input, int capacity) /// private int GetIndexForOffset(int offset) { - int index = firstIndex + offset; - if (index >= buffer.Length) - { - index -= buffer.Length; - } - return index; + return (firstIndex + offset) & mask; } /// @@ -79,16 +88,20 @@ private int GetIndexForOffset(int offset) /// public char Peek(int offset) { - if (offset < 0 || offset >= buffer.Length) +#if DEBUG + if (offset < 0 || offset >= blockSize) { throw new ArgumentOutOfRangeException(nameof(offset), "The offset must be between zero and the capacity of the buffer."); } - - Cache(offset); +#endif + if (offset >= count) + { + FillBuffer(); + } if (offset < count) { - return buffer[GetIndexForOffset(offset)]; + return buffer[(firstIndex + offset) & mask]; } else { @@ -104,30 +117,27 @@ public char Peek(int offset) /// public void Cache(int length) { - while (length >= count) + if (length >= count) { - var nextChar = input.Read(); - if (nextChar >= 0) - { - var lastIndex = GetIndexForOffset(count); - buffer[lastIndex] = (char)nextChar; - ++count; - } - else - { - endOfInput = true; - return; - } + FillBuffer(); } } + private void FillBuffer() + { + var readCount = input.Read(buffer, writeOffset, blockSize); + writeOffset = blockSize - writeOffset; + endOfInput = readCount < blockSize; + count += readCount; + } + /// /// Skips the next characters. Those characters must have been /// obtained first by calling the or methods. /// public void Skip(int length) { - if (length < 1 || length > count) + if (length < 1 || length > blockSize) { throw new ArgumentOutOfRangeException(nameof(length), "The length must be between 1 and the number of characters in the buffer. Use the Peek() and / or Cache() methods to fill the buffer."); } diff --git a/YamlDotNet/Core/Scanner.cs b/YamlDotNet/Core/Scanner.cs index 097d7f725..6d9c4dcb0 100644 --- a/YamlDotNet/Core/Scanner.cs +++ b/YamlDotNet/Core/Scanner.cs @@ -109,7 +109,7 @@ public class Scanner : IScanner /// Indicates whether comments should be ignored public Scanner(TextReader input, bool skipComments = true) { - analyzer = new CharacterAnalyzer(new LookAheadBuffer(input, MaxBufferLength)); + analyzer = new CharacterAnalyzer(new LookAheadBuffer(input, 1024)); cursor = new Cursor(); SkipComments = skipComments; } From 92b690e0efbbaf6eda851540f05912afc7d326fb Mon Sep 17 00:00:00 2001 From: Antoine Aubry Date: Mon, 21 Sep 2020 15:48:09 +0100 Subject: [PATCH 3/3] Refactor the performance tests to make it easier to reference a new version --- .gitignore | 2 + ...YamlDotNet.PerformanceTests.Builder.csproj | 22 ++ .../versions.props | 12 + .../Properties/AssemblyInfo.cs | 43 ---- .../YamlDotNet.PerformanceTests.Lib.csproj | 11 - .../Program.cs | 240 +++++++++++++----- .../YamlDotNet.PerformanceTests.Runner.csproj | 23 +- .../Program.cs | 34 --- .../Properties/AssemblyInfo.cs | 43 ---- .../ReceiptTest.cs | 43 ---- .../YamlDotNet.PerformanceTests.v1.2.1.csproj | 18 -- .../Program.cs | 34 --- .../Properties/AssemblyInfo.cs | 43 ---- .../ReceiptTest.cs | 44 ---- .../YamlDotNet.PerformanceTests.v2.2.0.csproj | 18 -- .../Program.cs | 34 --- .../Properties/AssemblyInfo.cs | 43 ---- .../ReceiptTest.cs | 44 ---- .../YamlDotNet.PerformanceTests.v2.3.0.csproj | 18 -- .../Program.cs | 34 --- .../Properties/AssemblyInfo.cs | 42 --- .../ReceiptTest.cs | 44 ---- .../YamlDotNet.PerformanceTests.v3.8.0.csproj | 17 -- .../Program.cs | 34 --- .../Properties/AssemblyInfo.cs | 42 --- .../ReceiptTest.cs | 46 ---- .../YamlDotNet.PerformanceTests.v4.0.0.csproj | 17 -- .../AllowNonOptimized.cs | 18 -- .../Program.cs | 33 --- .../Properties/AssemblyInfo.cs | 42 --- .../ReceiptTest.cs | 46 ---- .../YamlDotNet.PerformanceTests.v5.2.1.csproj | 17 -- .../AllowNonOptimized.cs | 18 -- .../Program.cs | 33 --- .../Properties/AssemblyInfo.cs | 42 --- .../ReceiptTest.cs | 46 ---- .../YamlDotNet.PerformanceTests.v8.0.0.csproj | 17 -- .../Properties/AssemblyInfo.cs | 57 ----- .../ReceiptTest.cs | 46 ---- ...YamlDotNet.PerformanceTests.vlatest.csproj | 19 -- .../BuildPropertiesAttribute.cs} | 18 +- .../YamlDotNet.PerformanceTests/Program.cs | 64 +++++ .../ReceiptTest.cs | 127 +++++++++ .../TestData.cs} | 58 ++++- .../YamlDotNet.PerformanceTests.csproj | 64 +++++ YamlDotNet.sln | 106 +++----- YamlDotNet/Core/Scanner.cs | 1 - 47 files changed, 561 insertions(+), 1356 deletions(-) create mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.Builder/YamlDotNet.PerformanceTests.Builder.csproj create mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.Builder/versions.props delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.Lib/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.Lib/YamlDotNet.PerformanceTests.Lib.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/YamlDotNet.PerformanceTests.v1.2.1.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/YamlDotNet.PerformanceTests.v2.2.0.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/YamlDotNet.PerformanceTests.v2.3.0.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/YamlDotNet.PerformanceTests.v3.8.0.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/YamlDotNet.PerformanceTests.v4.0.0.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/AllowNonOptimized.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/YamlDotNet.PerformanceTests.v5.2.1.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/AllowNonOptimized.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Program.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/YamlDotNet.PerformanceTests.v8.0.0.csproj delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Properties/AssemblyInfo.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.vlatest/ReceiptTest.cs delete mode 100644 PerformanceTests/YamlDotNet.PerformanceTests.vlatest/YamlDotNet.PerformanceTests.vlatest.csproj rename PerformanceTests/{YamlDotNet.PerformanceTests.vlatest/Program.cs => YamlDotNet.PerformanceTests/BuildPropertiesAttribute.cs} (61%) create mode 100644 PerformanceTests/YamlDotNet.PerformanceTests/Program.cs create mode 100644 PerformanceTests/YamlDotNet.PerformanceTests/ReceiptTest.cs rename PerformanceTests/{YamlDotNet.PerformanceTests.Lib/Tests/Receipt.cs => YamlDotNet.PerformanceTests/TestData.cs} (67%) create mode 100644 PerformanceTests/YamlDotNet.PerformanceTests/YamlDotNet.PerformanceTests.csproj diff --git a/.gitignore b/.gitignore index fdb788f9a..bd4b874eb 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ YamlDotNet/Properties/AssemblyInfo.Generated.cs /.vs /YamlDotNet/Properties/AssemblyInfo.cs +BenchmarkDotNet.Artifacts + diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Builder/YamlDotNet.PerformanceTests.Builder.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.Builder/YamlDotNet.PerformanceTests.Builder.csproj new file mode 100644 index 000000000..bc8d51f49 --- /dev/null +++ b/PerformanceTests/YamlDotNet.PerformanceTests.Builder/YamlDotNet.PerformanceTests.Builder.csproj @@ -0,0 +1,22 @@ + + + 2.0 + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3} + Release + AnyCPU + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Builder/versions.props b/PerformanceTests/YamlDotNet.PerformanceTests.Builder/versions.props new file mode 100644 index 000000000..27802897b --- /dev/null +++ b/PerformanceTests/YamlDotNet.PerformanceTests.Builder/versions.props @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.Lib/Properties/AssemblyInfo.cs deleted file mode 100644 index 7d1c32e3c..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.Lib")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/YamlDotNet.PerformanceTests.Lib.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.Lib/YamlDotNet.PerformanceTests.Lib.csproj deleted file mode 100644 index 23b06baf8..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/YamlDotNet.PerformanceTests.Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net461 - false - YamlDotNet.PerformanceTests.Lib - YamlDotNet.PerformanceTests.Lib - - - - - diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Runner/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.Runner/Program.cs index c3d711d5e..9ad68b6ba 100644 --- a/PerformanceTests/YamlDotNet.PerformanceTests.Runner/Program.cs +++ b/PerformanceTests/YamlDotNet.PerformanceTests.Runner/Program.cs @@ -20,51 +20,63 @@ // SOFTWARE. using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Collections.Generic; -using System.Reflection; -using System.Text.RegularExpressions; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Extensions; -using BenchmarkDotNet.Running; +using YamlDotNet.Serialization; namespace YamlDotNet.PerformanceTests.Runner { class MainClass { - public static void Main(string[] args) + public static void Main() { var currentDir = Directory.GetCurrentDirectory(); - + var baseDir = currentDir; for (var i = 0; i < 4; ++i) { baseDir = Path.GetDirectoryName(baseDir); } - var baseDirLength = currentDir.IndexOf($"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}"); - - var configuration = currentDir.Substring(baseDirLength, currentDir.Length - baseDirLength).Trim(Path.DirectorySeparatorChar); + var testsBaseDir = Path.Combine(baseDir, "YamlDotNet.PerformanceTests", "bin"); - Console.WriteLine($"Configuration: {configuration}\n"); + var testPrograms = Directory.GetDirectories(testsBaseDir) + .SelectMany(d => Directory.GetDirectories(d)) + .SelectMany(d => new[] { Path.Combine(d, "YamlDotNet.PerformanceTests.exe"), Path.Combine(d, "YamlDotNet.PerformanceTests.dll") }) + .Where(f => File.Exists(f)) + .GroupBy(f => Path.GetDirectoryName(f), (_, f) => f.OrderBy(fn => Path.GetExtension(fn)).First()) // Favor .dll over .exe + //.Where(d => d.Contains("5.2.0")).Take(1) + .Select(f => new + { + Path = f, + Framework = Path.GetFileName(Path.GetDirectoryName(f)), + Version = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(f))), + }) + .OrderBy(p => p.Version == "latest" ? new Version(999, 999, 999) : Version.Parse(p.Version)).ThenBy(p => p.Framework) + .ToList(); - var testPrograms = Directory.GetDirectories(baseDir) - .Select(d => Path.Combine(d, configuration)) - .Where(d => d != currentDir) - .Where(Directory.Exists) - .SelectMany(d => Directory.GetFiles(d, "*.exe")) - .Where(f => Regex.IsMatch(f, @"YamlDotNet.PerformanceTests.(vlatest|v\d+\.\d+\.\d+)\.exe$")); + Console.Error.WriteLine($"Base dir: {testsBaseDir}"); + Console.Error.WriteLine("Discovered the following tests:"); + foreach (var testProgram in testPrograms) + { + Console.Error.WriteLine($" - version {testProgram.Version,-7} {testProgram.Framework,-13} .{testProgram.Path.Substring(testsBaseDir.Length)}"); + } var testResults = new List(); - foreach (var testProgram in testPrograms) + + for (int i = 0; i < testPrograms.Count; i++) { - Console.Error.WriteLine("Running {0}", Path.GetFileName(testProgram)); + var testProgram = testPrograms[i]; - RunTest(testProgram, testResults); + Console.Title = $"Running tests for YamlDotNet {testProgram.Version} for {testProgram.Framework} ({i + 1} of {testPrograms.Count})"; + + RunTest(testProgram.Path, testProgram.Version, testProgram.Framework, testResults); } + Console.Title = "Performance test results for YamlDotNet"; + PrintResult(testResults); } @@ -84,7 +96,7 @@ private static void PrintResult(List testResults) var resultsFromTest = testResults.Where(r => r.Test == test).OrderBy(p => p.Version).ToList(); var initialColumnWidth = resultsFromTest.Max(r => r.Version.Length); - var tableWith = initialColumnWidth + (columnWidth + 2) * metricsCount + metricsCount + 4; + var tableWith = initialColumnWidth + 16 + (columnWidth + 2) * metricsCount + metricsCount + 4; Console.WriteLine(); PrintLine(tableWith); @@ -94,26 +106,52 @@ private static void PrintResult(List testResults) PrintLine(tableWith); Console.Write($"| {string.Empty.PadLeft(initialColumnWidth)} |"); - Console.Write($" {nameof(TestResult.Mean).PadLeft(columnWidth)} |"); - Console.Write($" {nameof(TestResult.Error).PadLeft(columnWidth)} |"); - Console.Write($" {nameof(TestResult.StdDev).PadLeft(columnWidth)} |"); - Console.Write($" {nameof(TestResult.Gen0).PadLeft(columnWidth)} |"); - Console.Write($" {nameof(TestResult.Gen1).PadLeft(columnWidth)} |"); - Console.Write($" {nameof(TestResult.Allocated).PadLeft(columnWidth)} |"); + Console.Write($" {nameof(TestResult.Version),-13} |"); + Console.Write($" {nameof(TestResult.Mean),columnWidth} |"); + Console.Write($" {nameof(TestResult.Error),columnWidth} |"); + Console.Write($" {nameof(TestResult.StdDev),columnWidth} |"); + Console.Write($" {nameof(TestResult.Gen0),columnWidth} |"); + Console.Write($" {nameof(TestResult.Gen1),columnWidth} |"); + Console.Write($" {nameof(TestResult.Allocated),columnWidth} |"); Console.WriteLine(); PrintLine(tableWith); + static string FormatTime(double time) + { + if (double.IsNaN(time)) + { + return "N/A"; + } + + var units = new[] { "ns", "us", "ms", "s" }; + var currentUnit = units[0]; + foreach (var unit in units) + { + currentUnit = unit; + + if (time < 1000.0) + { + break; + } + + time /= 1000.0; + } + + return $"{time:G5} {currentUnit}"; + } + foreach (var result in resultsFromTest) { Console.Write($"| {result.Version.PadRight(initialColumnWidth)} |"); - Console.Write($" {result.Mean?.PadLeft(columnWidth)} |"); - Console.Write($" {result.Error?.PadLeft(columnWidth)} |"); - Console.Write($" {result.StdDev?.PadLeft(columnWidth)} |"); - Console.Write($" {result.Gen0?.PadLeft(columnWidth)} |"); - Console.Write($" {result.Gen1?.PadLeft(columnWidth)} |"); - Console.Write($" {result.Allocated?.PadLeft(columnWidth)} |"); + Console.Write($" {result.Framework,-13} |"); + Console.Write($" {FormatTime(result.Mean),columnWidth} |"); + Console.Write($" {FormatTime(result.Error),columnWidth} |"); + Console.Write($" {FormatTime(result.StdDev),columnWidth} |"); + Console.Write($" {result.Gen0,columnWidth} |"); + Console.Write($" {result.Gen1,columnWidth} |"); + Console.Write($" {result.Allocated,columnWidth} |"); Console.WriteLine(); } @@ -129,65 +167,127 @@ private static void PrintLine(int tableWith) Console.WriteLine(new String('-', tableWith)); } - private static void RunTest(string testProgram, List testResults) + private static void RunTest(string testProgram, string version, string framework, List testResults) { var startInfo = new ProcessStartInfo { UseShellExecute = false, - RedirectStandardOutput = true, }; - switch (Environment.OSVersion.Platform) + switch (Path.GetExtension(testProgram)) { - case PlatformID.Unix: + case ".dll": + startInfo.FileName = "dotnet"; + startInfo.Arguments = testProgram; + break; + + case ".exe" when Environment.OSVersion.Platform == PlatformID.Unix: startInfo.FileName = "mono"; startInfo.Arguments = testProgram; break; - default: + case ".exe": startInfo.FileName = testProgram; break; + + default: + throw new NotSupportedException(); } - var testProcess = Process.Start(startInfo); - testProcess.OutputDataReceived += (s, e) => ProcessTestResult(e.Data, testResults); - testProcess.BeginOutputReadLine(); + var reportPath = Path.Combine("BenchmarkDotNet.Artifacts", "results", "YamlDotNet.PerformanceTests.ReceiptTest-report-brief.json"); + if (File.Exists(reportPath)) + { + File.Delete(reportPath); + } + var testProcess = Process.Start(startInfo); testProcess.WaitForExit(); + + if (File.Exists(reportPath)) + { + using var reportFile = File.OpenText(reportPath); + var report = JsonParser.Deserialize(reportFile); + + foreach (var benchmark in report.Benchmarks) + { + testResults.Add(new TestResult + { + Test = $"{benchmark.Type}.{benchmark.Method}", + Version = version, + Framework = framework, + Mean = benchmark.Statistics?.Mean ?? double.NaN, + Error = benchmark.Statistics?.StandardError ?? double.NaN, + StdDev = benchmark.Statistics?.StandardDeviation ?? double.NaN, + Gen0 = benchmark.Memory?.Gen0Collections ?? -1, + Gen1 = benchmark.Memory?.Gen1Collections ?? -1, + Allocated = benchmark.Memory?.BytesAllocatedPerOperation ?? -1, + }); + } + } + else + { + testResults.Add(new TestResult + { + Test = "INVALID", + Version = version, + Framework = framework, + Mean = double.NaN, + Error = double.NaN, + StdDev = double.NaN, + Gen0 = -1, + Gen1 = -1, + Allocated = -1, + }); + } } - private class TestResult + private static readonly IDeserializer JsonParser = new DeserializerBuilder() + .IgnoreUnmatchedProperties() + .Build(); + + private class BriefReport { - public string Test { get; set; } - public string Version { get; set; } - public string Mean { get; set; } - public string Error { get; set; } - public string StdDev { get; set; } - public string Gen0 { get; set; } - public string Gen1 { get; set; } - public string Allocated { get; set; } + public List Benchmarks { get; set; } } - private static void ProcessTestResult(string data, List testResults) + private class Benchmark { - if (data != null && data.StartsWith(" 'Serialize v")) - { - var parts = data.Split('|'); - var versionName = parts[0].Trim().Trim('\'').Split(' '); - var result = new TestResult - { - Test = versionName[0], - Version = versionName[1], - Mean = parts.Length >= 1 ? parts[1].Trim() : string.Empty, - Error = parts.Length >= 2 ? parts[2].Trim() : string.Empty, - StdDev = parts.Length >= 3 ? parts[3].Trim() : string.Empty, - Gen0 = parts.Length >= 4 ? parts[4].Trim() : string.Empty, - Gen1 = parts.Length >= 5 ? parts[5].Trim() : string.Empty, - Allocated = parts.Length >= 6 ? parts[6].Trim() : string.Empty, - }; - - testResults.Add(result); - } + public string Type { get; set; } + public string Method { get; set; } + + public Statistics Statistics { get; set; } + public Memory Memory { get; set; } + } + + private class Statistics + { + public int N { get; set; } + public double Median { get; set; } + public double Mean { get; set; } + public double StandardError { get; set; } + public double StandardDeviation { get; set; } + } + + private class Memory + { + public int Gen0Collections { get; set; } + public int Gen1Collections { get; set; } + public int Gen2Collections { get; set; } + public int TotalOperations { get; set; } + public int BytesAllocatedPerOperation { get; set; } + } + + private class TestResult + { + public string Test { get; set; } + public string Version { get; set; } + public string Framework { get; internal set; } + public double Mean { get; set; } + public double Error { get; set; } + public double StdDev { get; set; } + public int Gen0 { get; set; } + public int Gen1 { get; set; } + public int Allocated { get; set; } } } } diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Runner/YamlDotNet.PerformanceTests.Runner.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.Runner/YamlDotNet.PerformanceTests.Runner.csproj index bac270f1f..b5a92eb89 100644 --- a/PerformanceTests/YamlDotNet.PerformanceTests.Runner/YamlDotNet.PerformanceTests.Runner.csproj +++ b/PerformanceTests/YamlDotNet.PerformanceTests.Runner/YamlDotNet.PerformanceTests.Runner.csproj @@ -1,15 +1,14 @@  - - Exe - net461 - false - YamlDotNet.PerformanceTests.Runner - YamlDotNet.PerformanceTests.Runner - + + Exe + net461 + false + YamlDotNet.PerformanceTests.Runner + YamlDotNet.PerformanceTests.Runner + 8.0 + - - - - - + + + \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Program.cs deleted file mode 100644 index 56c2f7f6b..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v1_2_1 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(); - } - } -} diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Properties/AssemblyInfo.cs deleted file mode 100644 index 0bbe19775..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle("YamlDotNet.PerformanceTests.v1.2.1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("aaubry")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/ReceiptTest.cs deleted file mode 100644 index abbf5ed57..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/ReceiptTest.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.RepresentationModel.Serialization; - -namespace YamlDotNet.PerformanceTests.v1_2_1 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly Serializer _serializer = new Serializer(); - - [Benchmark(Description = "Serialize v1.2.1")] - public void Serialize() - { - _serializer.Serialize (_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/YamlDotNet.PerformanceTests.v1.2.1.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/YamlDotNet.PerformanceTests.v1.2.1.csproj deleted file mode 100644 index ffd43e0e6..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v1.2.1/YamlDotNet.PerformanceTests.v1.2.1.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v1_2_1 - YamlDotNet.PerformanceTests.v1.2.1 - - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Program.cs deleted file mode 100644 index b04f1da6a..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v2_2_0 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Properties/AssemblyInfo.cs deleted file mode 100644 index ec774effe..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v2.2.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/ReceiptTest.cs deleted file mode 100644 index 58f5c37be..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/ReceiptTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.RepresentationModel.Serialization; -using YamlDotNet.RepresentationModel.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v2_2_0 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly Serializer _serializer = new Serializer(namingConvention: new CamelCaseNamingConvention()); - - [Benchmark(Description = "Serialize v2.2.0")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/YamlDotNet.PerformanceTests.v2.2.0.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/YamlDotNet.PerformanceTests.v2.2.0.csproj deleted file mode 100644 index 5c43b4d3d..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.2.0/YamlDotNet.PerformanceTests.v2.2.0.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v2_2_0 - YamlDotNet.PerformanceTests.v2.2.0 - - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Program.cs deleted file mode 100644 index 15f13c2c6..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v2_3_0 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Properties/AssemblyInfo.cs deleted file mode 100644 index 322b57ac6..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v2.3.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/ReceiptTest.cs deleted file mode 100644 index a16dd5f8d..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/ReceiptTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.RepresentationModel.Serialization; -using YamlDotNet.RepresentationModel.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v2_3_0 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly Serializer _serializer = new Serializer(namingConvention: new CamelCaseNamingConvention()); - - [Benchmark(Description = "Serialize v2.3.0")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/YamlDotNet.PerformanceTests.v2.3.0.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/YamlDotNet.PerformanceTests.v2.3.0.csproj deleted file mode 100644 index 62eaed647..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v2.3.0/YamlDotNet.PerformanceTests.v2.3.0.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v2_3_0 - YamlDotNet.PerformanceTests.v2.3.0 - - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Program.cs deleted file mode 100644 index 6dcd0d670..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v3_8_0 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Properties/AssemblyInfo.cs deleted file mode 100644 index a8997344c..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v3.8.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/ReceiptTest.cs deleted file mode 100644 index a08e2649f..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/ReceiptTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v3_8_0 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly Serializer _serializer = new Serializer(namingConvention: new CamelCaseNamingConvention()); - - [Benchmark(Description = "Serialize v3.8.0")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/YamlDotNet.PerformanceTests.v3.8.0.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/YamlDotNet.PerformanceTests.v3.8.0.csproj deleted file mode 100644 index eb91a7920..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v3.8.0/YamlDotNet.PerformanceTests.v3.8.0.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v3_8_0 - YamlDotNet.PerformanceTests.v3.8.0 - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Program.cs deleted file mode 100644 index 0828eb9eb..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v4_0_0 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Properties/AssemblyInfo.cs deleted file mode 100644 index 051be25ff..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v4.0.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/ReceiptTest.cs deleted file mode 100644 index 92500ab9e..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/ReceiptTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v4_0_0 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly Serializer _serializer = new SerializerBuilder() - .WithNamingConvention(new CamelCaseNamingConvention()) - .Build(); - - [Benchmark(Description = "Serialize v4.0.0")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/YamlDotNet.PerformanceTests.v4.0.0.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/YamlDotNet.PerformanceTests.v4.0.0.csproj deleted file mode 100644 index 0b122d19c..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v4.0.0/YamlDotNet.PerformanceTests.v4.0.0.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v4_0_0 - YamlDotNet.PerformanceTests.v4.0.0 - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/AllowNonOptimized.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/AllowNonOptimized.cs deleted file mode 100644 index 3395be2a6..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/AllowNonOptimized.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Linq; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Validators; - -namespace YamlDotNet.PerformanceTests.v5_2_1 -{ - public class AllowNonOptimized : ManualConfig - { - public AllowNonOptimized() - { - Add(JitOptimizationsValidator.DontFailOnError); // ALLOW NON-OPTIMIZED DLLS - - Add(DefaultConfig.Instance.GetLoggers().ToArray()); // manual config has no loggers by default - Add(DefaultConfig.Instance.GetExporters().ToArray()); // manual config has no exporters by default - Add(DefaultConfig.Instance.GetColumnProviders().ToArray()); // manual config has no columns by default - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Program.cs deleted file mode 100644 index 2bf5e6650..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v5_2_1 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(new AllowNonOptimized()); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Properties/AssemblyInfo.cs deleted file mode 100644 index 5e9b8a222..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v4.0.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/ReceiptTest.cs deleted file mode 100644 index 75cdf1d2b..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/ReceiptTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v5_2_1 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly ISerializer _serializer = new SerializerBuilder() - .WithNamingConvention(new CamelCaseNamingConvention()) - .Build(); - - [Benchmark(Description = "Serialize v5.2.1")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/YamlDotNet.PerformanceTests.v5.2.1.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/YamlDotNet.PerformanceTests.v5.2.1.csproj deleted file mode 100644 index fbd75102d..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v5.2.1/YamlDotNet.PerformanceTests.v5.2.1.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v5_2_1 - YamlDotNet.PerformanceTests.v5.2.1 - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/AllowNonOptimized.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/AllowNonOptimized.cs deleted file mode 100644 index 4f8eaeb5d..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/AllowNonOptimized.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Linq; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Validators; - -namespace YamlDotNet.PerformanceTests.v8_0_0 -{ - public class AllowNonOptimized : ManualConfig - { - public AllowNonOptimized() - { - Add(JitOptimizationsValidator.DontFailOnError); // ALLOW NON-OPTIMIZED DLLS - - Add(DefaultConfig.Instance.GetLoggers().ToArray()); // manual config has no loggers by default - Add(DefaultConfig.Instance.GetExporters().ToArray()); // manual config has no exporters by default - Add(DefaultConfig.Instance.GetColumnProviders().ToArray()); // manual config has no columns by default - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Program.cs deleted file mode 100644 index f2f115d73..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using BenchmarkDotNet.Running; - -namespace YamlDotNet.PerformanceTests.v8_0_0 -{ - public class Program - { - public static void Main(string[] args) - { - var summary = BenchmarkRunner.Run(new AllowNonOptimized()); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Properties/AssemblyInfo.cs deleted file mode 100644 index 5e9b8a222..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("YamlDotNet.PerformanceTests.v4.0.0")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("aaubry")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/ReceiptTest.cs deleted file mode 100644 index c0ef63915..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/ReceiptTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.v8_0_0 -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly ISerializer _serializer = new SerializerBuilder() - .WithNamingConvention(new CamelCaseNamingConvention()) - .Build(); - - [Benchmark(Description = "Serialize v8.0.0")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/YamlDotNet.PerformanceTests.v8.0.0.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/YamlDotNet.PerformanceTests.v8.0.0.csproj deleted file mode 100644 index 16bb7d7df..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.v8.0.0/YamlDotNet.PerformanceTests.v8.0.0.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.v8_0_0 - YamlDotNet.PerformanceTests.v8.0.0 - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Properties/AssemblyInfo.cs b/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Properties/AssemblyInfo.cs deleted file mode 100644 index f70c5f06c..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("YamlDotNet.PerformanceTests.vlatest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("YamlDotNet.PerformanceTests.vlatest")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("65ae194d-38d6-4b13-9a4b-65204c3b77e3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/ReceiptTest.cs deleted file mode 100644 index 93a082e8e..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/ReceiptTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -// This file is part of YamlDotNet - A .NET library for YAML. -// Copyright (c) Antoine Aubry and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System.IO; -using BenchmarkDotNet.Attributes; -using YamlDotNet.PerformanceTests.Lib.Tests; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace YamlDotNet.PerformanceTests.vlatest -{ - [MemoryDiagnoser] - public class ReceiptTest - { - private readonly Receipt _receipt = new Receipt(); - private readonly StringWriter _buffer = new StringWriter(); - - private readonly ISerializer _serializer = new SerializerBuilder() - .WithNamingConvention(CamelCaseNamingConvention.Instance) - .Build(); - - [Benchmark(Description = "Serialize vlatest")] - public void Serialize() - { - _serializer.Serialize(_buffer, _receipt.Graph); - } - } -} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/YamlDotNet.PerformanceTests.vlatest.csproj b/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/YamlDotNet.PerformanceTests.vlatest.csproj deleted file mode 100644 index e8c2e258a..000000000 --- a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/YamlDotNet.PerformanceTests.vlatest.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - Exe - net461 - false - YamlDotNet.PerformanceTests.vlatest - YamlDotNet.PerformanceTests.vlatest - - - - - - - - - - - - \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests/BuildPropertiesAttribute.cs similarity index 61% rename from PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Program.cs rename to PerformanceTests/YamlDotNet.PerformanceTests/BuildPropertiesAttribute.cs index a5d8fdc69..b339c3581 100644 --- a/PerformanceTests/YamlDotNet.PerformanceTests.vlatest/Program.cs +++ b/PerformanceTests/YamlDotNet.PerformanceTests/BuildPropertiesAttribute.cs @@ -20,15 +20,23 @@ // SOFTWARE. using System; -using BenchmarkDotNet.Running; -namespace YamlDotNet.PerformanceTests.vlatest +namespace YamlDotNet.PerformanceTests { - public class Program + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] + public class BuildPropertiesAttribute : Attribute { - public static void Main(string[] args) + public BuildPropertiesAttribute(string testVersion, string baseIntermediateOutputPath, string msbuildProjectExtensionsPath, string targetFramework) { - var summary = BenchmarkRunner.Run(); + TestVersion = testVersion; + BaseIntermediateOutputPath = baseIntermediateOutputPath; + MSBuildProjectExtensionsPath = msbuildProjectExtensionsPath; + TargetFramework = targetFramework; } + + public string TestVersion { get; } + public string BaseIntermediateOutputPath { get; } + public string MSBuildProjectExtensionsPath { get; } + public string TargetFramework { get; } } } \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests/Program.cs b/PerformanceTests/YamlDotNet.PerformanceTests/Program.cs new file mode 100644 index 000000000..d8c964577 --- /dev/null +++ b/PerformanceTests/YamlDotNet.PerformanceTests/Program.cs @@ -0,0 +1,64 @@ +// This file is part of YamlDotNet - A .NET library for YAML. +// Copyright (c) Antoine Aubry and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkDotNet.Running; +using System; +using System.Reflection; + +namespace YamlDotNet.PerformanceTests +{ + public class Program + { + private static BuildPropertiesAttribute buildProperties; + + public static BuildPropertiesAttribute BuildProperties + { + get + { + if (buildProperties is null) + { + buildProperties = typeof(Program).Assembly.GetCustomAttribute() + ?? throw new InvalidOperationException("Missing build properties"); + } + return buildProperties; + } + } + + public static void Main(string[] args) + { + var summary = BenchmarkRunner.Run(DefaultConfig.Instance + .AddJob(Job.Default + //.WithArguments(new[] + //{ + // //new MsBuildArgument($"/p:{nameof(BuildProperties.BaseIntermediateOutputPath)}={BuildProperties.BaseIntermediateOutputPath}"), + // //new MsBuildArgument($"/p:{nameof(BuildProperties.MSBuildProjectExtensionsPath)}={BuildProperties.MSBuildProjectExtensionsPath}"), + // //new MsBuildArgument($"/p:{nameof(BuildProperties.TestVersion)}={BuildProperties.TestVersion}"), + //}) +#if NETCOREAPP3_1 + .WithToolchain(BenchmarkDotNet.Toolchains.CsProj.CsProjCoreToolchain.NetCoreApp31) +#endif + ) + ); + } + } +} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests/ReceiptTest.cs b/PerformanceTests/YamlDotNet.PerformanceTests/ReceiptTest.cs new file mode 100644 index 000000000..e6bf1b780 --- /dev/null +++ b/PerformanceTests/YamlDotNet.PerformanceTests/ReceiptTest.cs @@ -0,0 +1,127 @@ +// This file is part of YamlDotNet - A .NET library for YAML. +// Copyright (c) Antoine Aubry and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +using BenchmarkDotNet.Attributes; +using Dia2Lib; +using System; +using System.IO; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; + +namespace YamlDotNet.PerformanceTests +{ + [MemoryDiagnoser] + [JsonExporterAttribute.Brief] + public class ReceiptTest + { + [GlobalSetup] + public void PrintHeader() + { + Console.WriteLine(" +------------------------------+"); + Console.WriteLine(" | YamlDotNet performance tests |"); + Console.WriteLine(" | |"); + Console.WriteLine(" | Version: {0,-13 } |", Program.BuildProperties.TestVersion); + Console.WriteLine(" | Framework: {0,-13 } |", Program.BuildProperties.TargetFramework); + Console.WriteLine(" +------------------------------+"); + Console.WriteLine(); + } + + +#if YAMLDOTNET_3_X_X + + private readonly Serializer _serializer = new Serializer(namingConvention: new CamelCaseNamingConvention()); + private readonly Deserializer _deserializer = new Deserializer(namingConvention: new CamelCaseNamingConvention()); + +#elif YAMLDOTNET_4_X_X + + private readonly Serializer _serializer = new SerializerBuilder() + .WithNamingConvention(new CamelCaseNamingConvention()) + .Build(); + + private readonly Deserializer _deserializer = new DeserializerBuilder() + .WithNamingConvention(new CamelCaseNamingConvention()) + .Build(); + +#elif YAMLDOTNET_5_X_X + + private readonly ISerializer _serializer = new SerializerBuilder() + .WithNamingConvention(new CamelCaseNamingConvention()) + .Build(); + + private readonly IDeserializer _deserializer = new DeserializerBuilder() + .WithNamingConvention(new CamelCaseNamingConvention()) + .Build(); + +#else + + private readonly ISerializer _serializer = new SerializerBuilder() + .WithNamingConvention(CamelCaseNamingConvention.Instance) + .Build(); + + private readonly IDeserializer _deserializer = new DeserializerBuilder() + .WithNamingConvention(CamelCaseNamingConvention.Instance) + .Build(); + +#endif + + private readonly Receipt _receipt = TestData.Graph; + private readonly string _yaml = @" +receipt: Oz-Ware Purchase Invoice +date: 2007-08-06T00:00:00.0000000 +customer: + given: Dorothy + family: Gale +items: +- partNo: A4786 + descrip: Water Bucket (Filled) + price: 1.47 + quantity: 4 +- partNo: E1628 + descrip: High Heeled ""Ruby"" Slippers + price: 100.27 + quantity: 1 +billTo: &o0 + street: >- + 123 Tornado Alley + Suite 16 + city: East Westville + state: KS +shipTo: *o0 +specialDelivery: >- + Follow the Yellow Brick + Road to the Emerald City. + Pay no attention to the + man behind the curtain. +"; + + [Benchmark] + public void Serialize() + { + _serializer.Serialize(new StringWriter(), _receipt); + } + + [Benchmark] + public void Deserialize() + { + _deserializer.Deserialize(new StringReader(_yaml)); + } + } +} \ No newline at end of file diff --git a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/Tests/Receipt.cs b/PerformanceTests/YamlDotNet.PerformanceTests/TestData.cs similarity index 67% rename from PerformanceTests/YamlDotNet.PerformanceTests.Lib/Tests/Receipt.cs rename to PerformanceTests/YamlDotNet.PerformanceTests/TestData.cs index ba9a19af2..1070dae71 100644 --- a/PerformanceTests/YamlDotNet.PerformanceTests.Lib/Tests/Receipt.cs +++ b/PerformanceTests/YamlDotNet.PerformanceTests/TestData.cs @@ -1,16 +1,16 @@ // This file is part of YamlDotNet - A .NET library for YAML. // Copyright (c) Antoine Aubry and contributors - + // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: - + // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. - + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,38 +21,40 @@ using System; -namespace YamlDotNet.PerformanceTests.Lib.Tests +namespace YamlDotNet.PerformanceTests { - public class Receipt + public class TestData { - public object Graph { - get { - var address = new + public static Receipt Graph + { + get + { + var address = new Address { street = "123 Tornado Alley\nSuite 16", city = "East Westville", state = "KS" }; - var receipt = new + var receipt = new Receipt { receipt = "Oz-Ware Purchase Invoice", date = new DateTime(2007, 8, 6), - customer = new + customer = new Customer { given = "Dorothy", family = "Gale" }, items = new[] { - new + new OrderItem { part_no = "A4786", descrip = "Water Bucket (Filled)", price = 1.47M, quantity = 4 }, - new + new OrderItem { part_no = "E1628", descrip = "High Heeled \"Ruby\" Slippers", @@ -72,5 +74,37 @@ public class Receipt } } } + + public class Receipt + { + public string receipt { get; set; } + public DateTime date { get; set; } + public Customer customer { get; set; } + public OrderItem[] items { get; set; } + public Address bill_to { get; set; } + public Address ship_to { get; set; } + public string specialDelivery { get; set; } + } + + public class OrderItem + { + public string part_no { get; set; } + public string descrip { get; set; } + public decimal price { get; set; } + public int quantity { get; set; } + } + + public class Customer + { + public string given { get; set; } + public string family { get; set; } + } + + public class Address + { + public string street { get; set; } + public string city { get; set; } + public string state { get; set; } + } } diff --git a/PerformanceTests/YamlDotNet.PerformanceTests/YamlDotNet.PerformanceTests.csproj b/PerformanceTests/YamlDotNet.PerformanceTests/YamlDotNet.PerformanceTests.csproj new file mode 100644 index 000000000..d2d667af7 --- /dev/null +++ b/PerformanceTests/YamlDotNet.PerformanceTests/YamlDotNet.PerformanceTests.csproj @@ -0,0 +1,64 @@ + + + + latest + $(TestVersion.Split('.')[0]) + $(DefineConstants);YAMLDOTNET_$(MajorVersion)_X_X + + Exe + net461;netcoreapp3.1 + net461 + 8.0 + False + false + bin\$(TestVersion)\$(TargetFramework)\ + true + AnyCPU + + + + + + + + + + + + + + + ..\..\YamlDotNet\bin\Release\net45\YamlDotNet.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YamlDotNet.sln b/YamlDotNet.sln index b1e86cef9..73bbca4ad 100644 --- a/YamlDotNet.sln +++ b/YamlDotNet.sln @@ -3,35 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29123.88 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet", "YamlDotNet\YamlDotNet.csproj", "{ABFC2E37-119B-439D-82B6-49E9680EEA90}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet", "YamlDotNet\YamlDotNet.csproj", "{ABFC2E37-119B-439D-82B6-49E9680EEA90}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.Samples", "YamlDotNet.Samples\YamlDotNet.Samples.csproj", "{689D2A30-C52E-4CF8-8BA1-3178F4EB245A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Samples", "YamlDotNet.Samples\YamlDotNet.Samples.csproj", "{689D2A30-C52E-4CF8-8BA1-3178F4EB245A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.Test", "YamlDotNet.Test\YamlDotNet.Test.csproj", "{A9F67018-0240-4D16-A4EA-BCB780D0AF05}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Test", "YamlDotNet.Test\YamlDotNet.Test.csproj", "{A9F67018-0240-4D16-A4EA-BCB780D0AF05}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerformanceTests", "PerformanceTests", "{9A64B652-30A5-4632-AF4D-716EF29C5250}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.Lib", "PerformanceTests\YamlDotNet.PerformanceTests.Lib\YamlDotNet.PerformanceTests.Lib.csproj", "{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v1.2.1", "PerformanceTests\YamlDotNet.PerformanceTests.v1.2.1\YamlDotNet.PerformanceTests.v1.2.1.csproj", "{0FB497EA-A116-406A-AE8C-A24933D8CB21}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v2.2.0", "PerformanceTests\YamlDotNet.PerformanceTests.v2.2.0\YamlDotNet.PerformanceTests.v2.2.0.csproj", "{C6E0B465-8422-4D6B-85CE-C59724A28E1F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v2.3.0", "PerformanceTests\YamlDotNet.PerformanceTests.v2.3.0\YamlDotNet.PerformanceTests.v2.3.0.csproj", "{BE49A287-5F47-4E3B-90EB-97B51451934C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v3.8.0", "PerformanceTests\YamlDotNet.PerformanceTests.v3.8.0\YamlDotNet.PerformanceTests.v3.8.0.csproj", "{CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v4.0.0", "PerformanceTests\YamlDotNet.PerformanceTests.v4.0.0\YamlDotNet.PerformanceTests.v4.0.0.csproj", "{747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v5.2.1", "PerformanceTests\YamlDotNet.PerformanceTests.v5.2.1\YamlDotNet.PerformanceTests.v5.2.1.csproj", "{BDD556C6-A2A3-46C2-B70A-CA86C16BC060}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.v8.0.0", "PerformanceTests\YamlDotNet.PerformanceTests.v8.0.0\YamlDotNet.PerformanceTests.v8.0.0.csproj", "{C0363835-93DB-4AF1-9E3C-0689C65D0FD7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.vlatest", "PerformanceTests\YamlDotNet.PerformanceTests.vlatest\YamlDotNet.PerformanceTests.vlatest.csproj", "{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.Runner", "PerformanceTests\YamlDotNet.PerformanceTests.Runner\YamlDotNet.PerformanceTests.Runner.csproj", "{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.PerformanceTests.Runner", "PerformanceTests\YamlDotNet.PerformanceTests.Runner\YamlDotNet.PerformanceTests.Runner.csproj", "{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}" + ProjectSection(ProjectDependencies) = postProject + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3} = {2C86D85C-A483-4F17-8897-2B53DC1DBFA3} + EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.AotTest", "YamlDotNet.AotTest\YamlDotNet.AotTest.csproj", "{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.AotTest", "YamlDotNet.AotTest\YamlDotNet.AotTest.csproj", "{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EB11D2D9-6E3D-45BF-8BCD-A04BCB1F8020}" ProjectSection(SolutionItems) = preProject @@ -56,6 +41,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{45384A docker\Dummy.csproj = docker\Dummy.csproj EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.PerformanceTests.Builder", "PerformanceTests\YamlDotNet.PerformanceTests.Builder\YamlDotNet.PerformanceTests.Builder.csproj", "{2C86D85C-A483-4F17-8897-2B53DC1DBFA3}" + ProjectSection(ProjectDependencies) = postProject + {ABFC2E37-119B-439D-82B6-49E9680EEA90} = {ABFC2E37-119B-439D-82B6-49E9680EEA90} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.PerformanceTests", "PerformanceTests\YamlDotNet.PerformanceTests\YamlDotNet.PerformanceTests.csproj", "{A173861D-BE16-418F-9CCA-22554E208801}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -79,75 +71,37 @@ Global {A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU {A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release|Any CPU.ActiveCfg = Release|Any CPU {A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release|Any CPU.Build.0 = Release|Any CPU - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Debug|Any CPU.Build.0 = Debug|Any CPU - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release|Any CPU.ActiveCfg = Release|Any CPU - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release|Any CPU.Build.0 = Release|Any CPU - {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release|Any CPU.Build.0 = Release|Any CPU - {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release|Any CPU.Build.0 = Release|Any CPU - {BE49A287-5F47-4E3B-90EB-97B51451934C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE49A287-5F47-4E3B-90EB-97B51451934C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE49A287-5F47-4E3B-90EB-97B51451934C}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {BE49A287-5F47-4E3B-90EB-97B51451934C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE49A287-5F47-4E3B-90EB-97B51451934C}.Release|Any CPU.Build.0 = Release|Any CPU - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11}.Release|Any CPU.Build.0 = Release|Any CPU - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}.Debug|Any CPU.Build.0 = Debug|Any CPU - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}.Release|Any CPU.ActiveCfg = Release|Any CPU - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036}.Release|Any CPU.Build.0 = Release|Any CPU - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060}.Release|Any CPU.Build.0 = Release|Any CPU - {C0363835-93DB-4AF1-9E3C-0689C65D0FD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C0363835-93DB-4AF1-9E3C-0689C65D0FD7}.Release|Any CPU.Build.0 = Release|Any CPU - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release|Any CPU.Build.0 = Release|Any CPU {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Debug|Any CPU.Build.0 = Debug|Any CPU {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU - {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release|Any CPU.Build.0 = Release|Any CPU + {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release|Any CPU.Build.0 = Debug|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug-AOT|Any CPU.Build.0 = Debug|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Release|Any CPU.Build.0 = Release|Any CPU + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3}.Debug-AOT|Any CPU.Build.0 = Debug|Any CPU + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3}.Release|Any CPU.Build.0 = Release|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Debug-AOT|Any CPU.ActiveCfg = Debug|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Debug-AOT|Any CPU.Build.0 = Debug|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A173861D-BE16-418F-9CCA-22554E208801}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {0FB497EA-A116-406A-AE8C-A24933D8CB21} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {C6E0B465-8422-4D6B-85CE-C59724A28E1F} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {BE49A287-5F47-4E3B-90EB-97B51451934C} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {CE856C44-2FE0-4AFA-99CE-F8A076F1BA11} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {747DD2E9-2A0A-4D5E-8D97-85AA9AC5A036} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {BDD556C6-A2A3-46C2-B70A-CA86C16BC060} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {C0363835-93DB-4AF1-9E3C-0689C65D0FD7} = {9A64B652-30A5-4632-AF4D-716EF29C5250} - {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71} = {9A64B652-30A5-4632-AF4D-716EF29C5250} {A5C7D77C-0F08-4647-8376-3719BD6DEBD9} = {9A64B652-30A5-4632-AF4D-716EF29C5250} {45384A6E-A0A1-48DF-8FCC-B04405198048} = {EB11D2D9-6E3D-45BF-8BCD-A04BCB1F8020} + {2C86D85C-A483-4F17-8897-2B53DC1DBFA3} = {9A64B652-30A5-4632-AF4D-716EF29C5250} + {A173861D-BE16-418F-9CCA-22554E208801} = {9A64B652-30A5-4632-AF4D-716EF29C5250} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B388A06A-D288-4E48-B2A1-AE0E06E14EE4} diff --git a/YamlDotNet/Core/Scanner.cs b/YamlDotNet/Core/Scanner.cs index 6d9c4dcb0..b4ecd8319 100644 --- a/YamlDotNet/Core/Scanner.cs +++ b/YamlDotNet/Core/Scanner.cs @@ -35,7 +35,6 @@ namespace YamlDotNet.Core public class Scanner : IScanner { private const int MaxVersionNumberLength = 9; - private const int MaxBufferLength = 8; private static readonly IDictionary simpleEscapeCodes = new SortedDictionary {