-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
832 additions
and
124 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
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 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [Unreleased] - yyyy-mm-dd | ||
|
||
### Added | ||
- Create instances of types with parameterless constructors | ||
- Added Benchmarks to ensure performance | ||
|
||
### Changed | ||
|
||
### Fixed | ||
|
||
## [1.2.3] - 2022-08-15 | ||
|
||
### Added | ||
|
||
### Changed | ||
- Downgrade to netstandard2.0 instead of netstandard2.1 | ||
- Update building to use [https://nuke.build/](https://nuke.build/) | ||
|
||
### Fixed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using MeasureMap; | ||
using System.Text; | ||
using YamlMap; | ||
using YamlMap.Benchmark; | ||
|
||
var value = new StringBuilder().AppendLine("Simple: root") | ||
.AppendLine("StringList:") | ||
.AppendLine(" - one") | ||
.AppendLine(" - 2") | ||
.AppendLine("ObjList:") | ||
.AppendLine(" - Simple: simple") | ||
.AppendLine(" - Child:") | ||
.AppendLine(" Simple: child").ToString(); | ||
|
||
|
||
ProfilerSession.StartSession() | ||
.SetIterations(10) | ||
.SetThreads(10) | ||
.Task(c => | ||
{ | ||
var reader = new YamlReader(); | ||
reader.Read<TestlItem>(value); | ||
}) | ||
.RunSession() | ||
.Trace(); | ||
|
||
|
||
//ProfilerSession.StartSession() | ||
// .SetIterations(10) | ||
// .Task(c => | ||
// { | ||
// var reader = new YamlReader(); | ||
// reader.Read<TestlItem>(value); | ||
// }) | ||
// .RunSession() | ||
// .Trace(); |
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,67 @@ | ||
|
||
|
||
|
||
# MeasureMap - v1.2.4 | ||
## Summary | ||
| Category | Metric | Value | | ||
| --- | --- | ---: | | ||
| Warmup | Duration Warmup | 00:00:00.0850161 | | ||
| Setup | Threads | 10 | | ||
| | Iterations | 100 | | ||
| Duration | Duration | 00:00:00.2859164 | | ||
| | Total Time | 00:00:00.5425069 | | ||
| | Average Time | 00:00:00.0054250 | | ||
| | Average Milliseconds | 5.425 ms | | ||
| | Throughput | 349.75259/s | | ||
| | Fastest | 00:00:00.0003884 | | ||
| | Slowest | 00:00:00.0147817 | | ||
| Memory | Memory Initial size | 128336 | | ||
| | Memory End size | 185048 | | ||
| | Memory Increase | 56712 | | ||
|
||
## Details per Thread | ||
| ThreadId | Iterations | Average Time | Slowest | Fastest | Throughput | | ||
| --- | --- | ---: | ---: | ---: | ---: | | ||
| 4 | 10 | 00:00:00.0058555 | 00:00:00.0140982 | 00:00:00.0014117 | 170.77873/s | | ||
| 5 | 10 | 00:00:00.0057905 | 00:00:00.0139230 | 00:00:00.0018329 | 172.69606/s | | ||
| 6 | 10 | 00:00:00.0038066 | 00:00:00.0065659 | 00:00:00.0012217 | 262.69886/s | | ||
| 7 | 10 | 00:00:00.0057911 | 00:00:00.0120258 | 00:00:00.0013858 | 172.67787/s | | ||
| 8 | 10 | 00:00:00.0062313 | 00:00:00.0130830 | 00:00:00.0038898 | 160.47887/s | | ||
| 9 | 10 | 00:00:00.0047726 | 00:00:00.0075059 | 00:00:00.0003884 | 209.5272/s | | ||
| 10 | 10 | 00:00:00.0045559 | 00:00:00.0072848 | 00:00:00.0005383 | 219.49271/s | | ||
| 11 | 10 | 00:00:00.0057704 | 00:00:00.0147817 | 00:00:00.0017698 | 173.29731/s | | ||
| 12 | 10 | 00:00:00.0047492 | 00:00:00.0073229 | 00:00:00.0011710 | 210.56178/s | | ||
| 13 | 10 | 00:00:00.0069272 | 00:00:00.0093442 | 00:00:00.0043829 | 144.3568/s | | ||
|
||
|
||
# MeasureMap - v1.2.3 | ||
## Summary | ||
| Category | Metric | Value | | ||
| --- | --- | ---: | | ||
| Warmup | Duration Warmup | 00:00:00.0934861 | | ||
| Setup | Threads | 10 | | ||
| | Iterations | 100 | | ||
| Duration | Duration | 00:00:00.3045892 | | ||
| | Total Time | 00:00:00.5476232 | | ||
| | Average Time | 00:00:00.0054762 | | ||
| | Average Milliseconds | 5.4762 ms | | ||
| | Throughput | 328.31105/s | | ||
| | Fastest | 00:00:00.0000867 | | ||
| | Slowest | 00:00:00.0143229 | | ||
| Memory | Memory Initial size | 126288 | | ||
| | Memory End size | 198552 | | ||
| | Memory Increase | 72264 | | ||
|
||
## Details per Thread | ||
| ThreadId | Iterations | Average Time | Slowest | Fastest | Throughput | | ||
| --- | --- | ---: | ---: | ---: | ---: | | ||
| 4 | 10 | 00:00:00.0071977 | 00:00:00.0141091 | 00:00:00.0026345 | 138.93231/s | | ||
| 5 | 10 | 00:00:00.0051405 | 00:00:00.0098962 | 00:00:00.0001348 | 194.53058/s | | ||
| 6 | 10 | 00:00:00.0051938 | 00:00:00.0099995 | 00:00:00.0014394 | 192.53689/s | | ||
| 7 | 10 | 00:00:00.0042084 | 00:00:00.0087129 | 00:00:00.0004524 | 237.61774/s | | ||
| 8 | 10 | 00:00:00.0064520 | 00:00:00.0143229 | 00:00:00.0000867 | 154.98926/s | | ||
| 9 | 10 | 00:00:00.0054007 | 00:00:00.0104453 | 00:00:00.0029130 | 185.15981/s | | ||
| 10 | 10 | 00:00:00.0051964 | 00:00:00.0071006 | 00:00:00.0030690 | 192.44092/s | | ||
| 11 | 10 | 00:00:00.0051198 | 00:00:00.0076924 | 00:00:00.0023300 | 195.3186/s | | ||
| 12 | 10 | 00:00:00.0051012 | 00:00:00.0089473 | 00:00:00.0002999 | 196.03077/s | | ||
| 13 | 10 | 00:00:00.0057514 | 00:00:00.0104961 | 00:00:00.0001130 | 173.8689/s | |
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 @@ | ||
| ||
namespace YamlMap.Benchmark | ||
{ | ||
public class TestlItem | ||
{ | ||
public string Simple { get; set; } | ||
|
||
public TestlItemChild Child { get; set; } | ||
|
||
public IEnumerable<string> StringList { get; set; } | ||
|
||
public IEnumerable<TestlItemChild> ObjList { get; set; } | ||
} | ||
|
||
public class TestlItemChild | ||
{ | ||
public string Simple { get; set; } | ||
|
||
public TestlItem Child { get; set; } | ||
|
||
public IEnumerable<string> StringList { get; set; } | ||
|
||
public IEnumerable<TestlItem> ObjList { get; set; } | ||
} | ||
} |
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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MeasureMap" Version="2.0.1-RC17" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\YamlMap\YamlMap.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
28 changes: 28 additions & 0 deletions
28
src/Tests/YamlMap.Tests/Serialization/ArrayInstanceFactoryTests.cs
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,28 @@ | ||
using FluentAssertions; | ||
using NUnit.Framework; | ||
using YamlMap.Serialization; | ||
|
||
namespace YamlMap.Tests.Serialization | ||
{ | ||
public class ArrayInstanceFactoryTests | ||
{ | ||
[Test] | ||
public void ArrayInstanceFactory_Type() | ||
{ | ||
var token = new Token("", 0); | ||
token.Set(new ValueToken("Value", "1", 0)); | ||
|
||
ArrayInstanceFactory.Factory.CreateInstance(typeof(int[]), token).Invoke().Should().BeAssignableTo<int[][]>(); | ||
} | ||
|
||
[Test] | ||
public void ArrayInstanceFactory_Length() | ||
{ | ||
var token = new Token("", 0); | ||
token.Set(new ValueToken("Value1", "1", 0)); | ||
token.Set(new ValueToken("Value2", "2", 0)); | ||
|
||
((int[][])ArrayInstanceFactory.Factory.CreateInstance(typeof(int[]), token).Invoke()).Should().HaveCount(2); | ||
} | ||
} | ||
} |
Oops, something went wrong.