-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #781 from RSuter/master
Release v9.10.74
- Loading branch information
Showing
27 changed files
with
489 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using NJsonSchema.Tests.Generation; | ||
using System.Threading.Tasks; | ||
using NJsonSchema.Infrastructure; | ||
|
||
using static NJsonSchema.Tests.Generation.XmlDocTests; | ||
|
||
namespace NJsonSchema.Benchmark | ||
{ | ||
public class GeneratorPerformance | ||
{ | ||
private readonly XmlDocTests _tests; | ||
|
||
public GeneratorPerformance() | ||
{ | ||
_tests = new XmlDocTests(); | ||
} | ||
|
||
[Benchmark] | ||
public async Task XmlDocTests() | ||
{ | ||
await typeof(ClassWithInheritdoc).GetMethod("Bar").GetXmlSummaryAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System.Diagnostics; | ||
using System.Threading.Tasks; | ||
using NBench; | ||
using NJsonSchema.Infrastructure; | ||
using Pro.NBench.xUnit.XunitExtensions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace NJsonSchema.Benchmark | ||
{ | ||
public class GeneratorPerformanceTests | ||
{ | ||
private readonly GeneratorPerformance _generatorPerformance = new GeneratorPerformance(); | ||
private Counter _counter; | ||
|
||
public GeneratorPerformanceTests(ITestOutputHelper output) | ||
{ | ||
Trace.Listeners.Clear(); | ||
Trace.Listeners.Add(new XunitTraceListener(output)); | ||
} | ||
|
||
[PerfSetup] | ||
#pragma warning disable xUnit1013 // Public method should be marked as test | ||
public void Setup(BenchmarkContext context) | ||
#pragma warning restore xUnit1013 // Public method should be marked as test | ||
{ | ||
_counter = context.GetCounter("Iterations"); | ||
} | ||
|
||
/// <summary> | ||
/// Ensure that we can serialise at least 200 times per second (5ms). | ||
/// </summary> | ||
[NBenchFact] | ||
[PerfBenchmark( | ||
Description = "Xml Docs (with cache)", | ||
NumberOfIterations = 3, | ||
RunTimeMilliseconds = 1000, | ||
RunMode = RunMode.Throughput, | ||
TestMode = TestMode.Test)] | ||
[CounterThroughputAssertion("Iterations", MustBe.GreaterThan, 200)] | ||
public void XmlDocTestsWithCache() | ||
{ | ||
_generatorPerformance.XmlDocTests().GetAwaiter().GetResult(); | ||
_counter.Increment(); | ||
} | ||
|
||
/// <summary> | ||
/// Ensure that we can serialise at least 200 times per second (5ms). | ||
/// </summary> | ||
[NBenchFact] | ||
[PerfBenchmark( | ||
Description = "Xml Docs (without cache)", | ||
NumberOfIterations = 3, | ||
RunTimeMilliseconds = 1000, | ||
RunMode = RunMode.Throughput, | ||
TestMode = TestMode.Test)] | ||
[CounterThroughputAssertion("Iterations", MustBe.GreaterThan, 200)] | ||
public void XmlDocTestsWithoutCache() | ||
{ | ||
XmlDocumentationExtensions.ClearCacheAsync().GetAwaiter().GetResult(); | ||
_generatorPerformance.XmlDocTests().GetAwaiter().GetResult(); | ||
_counter.Increment(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.