Skip to content

Commit 0b5641e

Browse files
committed
feat(*): add benchmarks project and dependencies.props
1 parent ef147e4 commit 0b5641e

18 files changed

+512
-125
lines changed

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 4
11+
charset = utf-8
12+
13+
[*.{csproj,props}]
14+
indent_size = 2

JsonApiDotnetCore.sln

+21-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{02
2828
EndProject
2929
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportsExample", "src\Examples\ReportsExample\ReportsExample.csproj", "{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}"
3030
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{076E1AE4-FD25-4684-B826-CAAE37FEA0AA}"
32+
EndProject
33+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "benchmarks\Benchmarks\Benchmarks.csproj", "{1F604666-BB0F-413E-922D-9D37C6073285}"
34+
EndProject
3135
Global
3236
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3337
Debug|Any CPU = Debug|Any CPU
@@ -106,10 +110,22 @@ Global
106110
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Debug|x86.Build.0 = Debug|Any CPU
107111
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
108112
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|Any CPU.Build.0 = Release|Any CPU
109-
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.ActiveCfg = Release|Any CPU
110-
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.Build.0 = Release|Any CPU
111-
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.ActiveCfg = Release|Any CPU
112-
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.Build.0 = Release|Any CPU
113+
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.ActiveCfg = Release|x64
114+
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.Build.0 = Release|x64
115+
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.ActiveCfg = Release|x86
116+
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.Build.0 = Release|x86
117+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
118+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|Any CPU.Build.0 = Debug|Any CPU
119+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x64.ActiveCfg = Debug|x64
120+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x64.Build.0 = Debug|x64
121+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x86.ActiveCfg = Debug|x86
122+
{1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x86.Build.0 = Debug|x86
123+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|Any CPU.ActiveCfg = Release|Any CPU
124+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|Any CPU.Build.0 = Release|Any CPU
125+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|x64.ActiveCfg = Release|x64
126+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|x64.Build.0 = Release|x64
127+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|x86.ActiveCfg = Release|x86
128+
{1F604666-BB0F-413E-922D-9D37C6073285}.Release|x86.Build.0 = Release|x86
113129
EndGlobalSection
114130
GlobalSection(SolutionProperties) = preSolution
115131
HideSolutionNode = FALSE
@@ -123,6 +139,7 @@ Global
123139
{6D4BD85A-A262-44C6-8572-FE3A30410BF3} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
124140
{026FBC6C-AF76-4568-9B87-EC73457899FD} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
125141
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
142+
{1F604666-BB0F-413E-922D-9D37C6073285} = {076E1AE4-FD25-4684-B826-CAAE37FEA0AA}
126143
EndGlobalSection
127144
GlobalSection(ExtensibilityGlobals) = postSolution
128145
SolutionGuid = {A2421882-8F0A-4905-928F-B550B192F9A4}

benchmarks/Benchmarks/.gitignore

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
_data/
2+
3+
## Ignore Visual Studio temporary files, build results, and
4+
## files generated by popular Visual Studio add-ons.
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Dd]ebugPublic/
18+
[Rr]elease/
19+
[Rr]eleases/
20+
x64/
21+
x86/
22+
build/
23+
bld/
24+
[Bb]in/
25+
[Oo]bj/
26+
27+
# Visual Studio 2015 cache/options directory
28+
.vs/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
31+
32+
# MSTest test Results
33+
[Tt]est[Rr]esult*/
34+
[Bb]uild[Ll]og.*
35+
36+
# NUNIT
37+
*.VisualState.xml
38+
TestResult.xml
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
# DNX
46+
project.lock.json
47+
artifacts/
48+
49+
*_i.c
50+
*_p.c
51+
*_i.h
52+
*.ilk
53+
*.meta
54+
*.obj
55+
*.pch
56+
*.pdb
57+
*.pgc
58+
*.pgd
59+
*.rsp
60+
*.sbr
61+
*.tlb
62+
*.tli
63+
*.tlh
64+
*.tmp
65+
*.tmp_proj
66+
*.log
67+
*.vspscc
68+
*.vssscc
69+
.builds
70+
*.pidb
71+
*.svclog
72+
*.scc
73+
74+
# Chutzpah Test files
75+
_Chutzpah*
76+
77+
# Visual C++ cache files
78+
ipch/
79+
*.aps
80+
*.ncb
81+
*.opendb
82+
*.opensdf
83+
*.sdf
84+
*.cachefile
85+
86+
# Visual Studio profiler
87+
*.psess
88+
*.vsp
89+
*.vspx
90+
*.sap
91+
92+
# TFS 2012 Local Workspace
93+
$tf/
94+
95+
# Guidance Automation Toolkit
96+
*.gpState
97+
98+
# ReSharper is a .NET coding add-in
99+
_ReSharper*/
100+
*.[Rr]e[Ss]harper
101+
*.DotSettings.user
102+
103+
# JustCode is a .NET coding add-in
104+
.JustCode
105+
106+
# TeamCity is a build add-in
107+
_TeamCity*
108+
109+
# DotCover is a Code Coverage Tool
110+
*.dotCover
111+
112+
# NCrunch
113+
_NCrunch_*
114+
.*crunch*.local.xml
115+
nCrunchTemp_*
116+
117+
# MightyMoose
118+
*.mm.*
119+
AutoTest.Net/
120+
121+
# Web workbench (sass)
122+
.sass-cache/
123+
124+
# Installshield output folder
125+
[Ee]xpress/
126+
127+
# DocProject is a documentation generator add-in
128+
DocProject/buildhelp/
129+
DocProject/Help/*.HxT
130+
DocProject/Help/*.HxC
131+
DocProject/Help/*.hhc
132+
DocProject/Help/*.hhk
133+
DocProject/Help/*.hhp
134+
DocProject/Help/Html2
135+
DocProject/Help/html
136+
137+
# Click-Once directory
138+
publish/
139+
140+
# Publish Web Output
141+
*.[Pp]ublish.xml
142+
*.azurePubxml
143+
# TODO: Comment the next line if you want to checkin your web deploy settings
144+
# but database connection strings (with potential passwords) will be unencrypted
145+
*.pubxml
146+
*.publishproj
147+
148+
# NuGet Packages
149+
*.nupkg
150+
# The packages folder can be ignored because of Package Restore
151+
**/packages/*
152+
# except build/, which is used as an MSBuild target.
153+
!**/packages/build/
154+
# Uncomment if necessary however generally it will be regenerated when needed
155+
#!**/packages/repositories.config
156+
157+
# Microsoft Azure Build Output
158+
csx/
159+
*.build.csdef
160+
161+
# Microsoft Azure Emulator
162+
ecf/
163+
rcf/
164+
165+
# Microsoft Azure ApplicationInsights config file
166+
ApplicationInsights.config
167+
168+
# Windows Store app package directory
169+
AppPackages/
170+
BundleArtifacts/
171+
172+
# Visual Studio cache files
173+
# files ending in .cache can be ignored
174+
*.[Cc]ache
175+
# but keep track of directories ending in .cache
176+
!*.[Cc]ache/
177+
178+
# Others
179+
ClientBin/
180+
~$*
181+
*~
182+
*.dbmdl
183+
*.dbproj.schemaview
184+
*.pfx
185+
*.publishsettings
186+
node_modules/
187+
orleans.codegen.cs
188+
189+
# RIA/Silverlight projects
190+
Generated_Code/
191+
192+
# Backup & report files from converting an old project file
193+
# to a newer Visual Studio version. Backup files are not needed,
194+
# because we have git ;-)
195+
_UpgradeReport_Files/
196+
Backup*/
197+
UpgradeLog*.XML
198+
UpgradeLog*.htm
199+
200+
# SQL Server files
201+
*.mdf
202+
*.ldf
203+
204+
# Business Intelligence projects
205+
*.rdl.data
206+
*.bim.layout
207+
*.bim_*.settings
208+
209+
# Microsoft Fakes
210+
FakesAssemblies/
211+
212+
# GhostDoc plugin setting file
213+
*.GhostDoc.xml
214+
215+
# Node.js Tools for Visual Studio
216+
.ntvs_analysis.dat
217+
218+
# Visual Studio 6 build log
219+
*.plg
220+
221+
# Visual Studio 6 workspace options file
222+
*.opt
223+
224+
# Visual Studio LightSwitch build output
225+
**/*.HTMLClient/GeneratedArtifacts
226+
**/*.DesktopClient/GeneratedArtifacts
227+
**/*.DesktopClient/ModelManifest.xml
228+
**/*.Server/GeneratedArtifacts
229+
**/*.Server/ModelManifest.xml
230+
_Pvt_Extensions
231+
232+
# Paket dependency manager
233+
.paket/paket.exe
234+
235+
# FAKE - F# Make
236+
.fake/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
``` ini
2+
3+
BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12
4+
Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4
5+
.NET Core SDK=2.0.0
6+
[Host] : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT
7+
DefaultJob : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT
8+
9+
10+
```
11+
| Method | Mean | Error | StdDev |
12+
|------------------------ |---------:|----------:|----------:|
13+
| DeserializeSimpleObject | 27.29 us | 0.5275 us | 0.5863 us |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,RemoveOutliers,Affinity,Jit,Platform,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,EnvironmentVariables,Toolchain,InvocationCount,IterationTime,LaunchCount,RunStrategy,TargetCount,UnrollFactor,WarmupCount,Mean,Error,StdDev
2+
DeserializeSimpleObject,Default,False,Default,Default,Default,Default,Default,Default,0,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,16,Default,27.29 us,0.5275 us,0.5863 us
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang='en'>
3+
<head>
4+
<meta charset='utf-8' />
5+
<title>JsonApiDeserializer_Benchmarks</title>
6+
7+
<style type="text/css">
8+
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
9+
td, th { padding: 6px 13px; border: 1px solid #ddd; }
10+
tr { background-color: #fff; border-top: 1px solid #ccc; }
11+
tr:nth-child(even) { background: #f8f8f8; }
12+
</style>
13+
</head>
14+
<body>
15+
<pre><code>
16+
BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12
17+
Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4
18+
.NET Core SDK=2.0.0
19+
[Host] : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT
20+
DefaultJob : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT
21+
</code></pre>
22+
<pre><code></code></pre>
23+
24+
<table>
25+
<thead><tr><th> Method</th><th>Mean</th><th>Error</th><th>StdDev</th>
26+
</tr>
27+
</thead><tbody><tr><td>DeserializeSimpleObject</td><td>27.29 us</td><td>0.5275 us</td><td>0.5863 us</td>
28+
</tr></tbody></table>
29+
</body>
30+
</html>
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\..\build\dependencies.props" />
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="BenchmarkDotNet" Version="0.10.10" />
9+
<PackageReference Include="moq" Version="$(MoqVersion)" />
10+
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj" />
14+
</ItemGroup>
15+
</Project>

benchmarks/Benchmarks/Program.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using BenchmarkDotNet.Running;
2+
using Benchmarks.Serialization;
3+
4+
namespace Benchmarks {
5+
class Program {
6+
static void Main(string[] args) {
7+
var summary = BenchmarkRunner.Run<JsonApiDeserializer_Benchmarks>();
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)