-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
9 changed files
with
215 additions
and
9 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
17 changes: 17 additions & 0 deletions
17
...et.Artifacts/results/Slugify.Core.Benchmarks.SlugifyBenchmarks-report-github.md
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,17 @@ | ||
``` ini | ||
|
||
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.18363.778 (1909/November2018Update/19H2) | ||
Intel Core i9-9900K CPU 3.60GHz (Coffee Lake), 1 CPU, 16 logical and 8 physical cores | ||
.NET Core SDK=3.1.201 | ||
[Host] : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT | ||
DefaultJob : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT | ||
|
||
|
||
``` | ||
| Method | N | word | Mean | Error | StdDev | Ratio | RatioSD | Gen 0 | Gen 1 | Gen 2 | Allocated | | ||
|--------- |-- |--------------------- |-----------:|---------:|---------:|------:|--------:|-------:|------:|------:|----------:| | ||
| **Baseline** | **1** | **Hello** | **660.0 ns** | **2.01 ns** | **1.78 ns** | **1.00** | **0.00** | **0.0734** | **-** | **-** | **616 B** | | ||
| Improved | 1 | Hello | 643.8 ns | 12.74 ns | 11.92 ns | 0.98 | 0.02 | 0.0553 | - | - | 464 B | | ||
| | | | | | | | | | | | | | ||
| **Baseline** | **1** | **lorem(...)oot!! [40]** | **4,174.1 ns** | **11.46 ns** | **10.72 ns** | **1.00** | **0.00** | **0.4501** | **-** | **-** | **3824 B** | | ||
| Improved | 1 | lorem(...)oot!! [40] | 3,924.9 ns | 7.03 ns | 5.87 ns | 0.94 | 0.00 | 0.3967 | - | - | 3360 B | |
5 changes: 5 additions & 0 deletions
5
...ks/BenchmarkDotNet.Artifacts/results/Slugify.Core.Benchmarks.SlugifyBenchmarks-report.csv
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,5 @@ | ||
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,N,word,Mean,Error,StdDev,Ratio,RatioSD,Gen 0,Gen 1,Gen 2,Allocated | ||
Baseline,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111111111111111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,1,Hello,660.0 ns,2.01 ns,1.78 ns,1.00,0.00,0.0734,0.0000,0.0000,616 B | ||
Improved,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111111111111111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,1,Hello,643.8 ns,12.74 ns,11.92 ns,0.98,0.02,0.0553,0.0000,0.0000,464 B | ||
Baseline,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111111111111111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,1,lorem(...)oot!! [40],"4,174.1 ns",11.46 ns,10.72 ns,1.00,0.00,0.4501,0.0000,0.0000,3824 B | ||
Improved,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111111111111111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,1,lorem(...)oot!! [40],"3,924.9 ns",7.03 ns,5.87 ns,0.94,0.00,0.3967,0.0000,0.0000,3360 B |
33 changes: 33 additions & 0 deletions
33
...s/BenchmarkDotNet.Artifacts/results/Slugify.Core.Benchmarks.SlugifyBenchmarks-report.html
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,33 @@ | ||
<!DOCTYPE html> | ||
<html lang='en'> | ||
<head> | ||
<meta charset='utf-8' /> | ||
<title>Slugify.Core.Benchmarks.SlugifyBenchmarks-20200430-160656</title> | ||
|
||
<style type="text/css"> | ||
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; } | ||
td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; } | ||
tr { background-color: #fff; border-top: 1px solid #ccc; } | ||
tr:nth-child(even) { background: #f8f8f8; } | ||
</style> | ||
</head> | ||
<body> | ||
<pre><code> | ||
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.18363.778 (1909/November2018Update/19H2) | ||
Intel Core i9-9900K CPU 3.60GHz (Coffee Lake), 1 CPU, 16 logical and 8 physical cores | ||
.NET Core SDK=3.1.201 | ||
[Host] : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT | ||
DefaultJob : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT | ||
</code></pre> | ||
<pre><code></code></pre> | ||
|
||
<table> | ||
<thead><tr><th>Method</th><th>N</th><th> word</th><th>Mean</th><th>Error</th><th>StdDev</th><th>Ratio</th><th>RatioSD</th><th>Gen 0</th><th>Gen 1</th><th>Gen 2</th><th>Allocated</th> | ||
</tr> | ||
</thead><tbody><tr><td>Baseline</td><td>1</td><td>Hello</td><td>660.0 ns</td><td>2.01 ns</td><td>1.78 ns</td><td>1.00</td><td>0.00</td><td>0.0734</td><td>-</td><td>-</td><td>616 B</td> | ||
</tr><tr><td>Improved</td><td>1</td><td>Hello</td><td>643.8 ns</td><td>12.74 ns</td><td>11.92 ns</td><td>0.98</td><td>0.02</td><td>0.0553</td><td>-</td><td>-</td><td>464 B</td> | ||
</tr><tr><td>Baseline</td><td>1</td><td>lorem(...)oot!! [40]</td><td>4,174.1 ns</td><td>11.46 ns</td><td>10.72 ns</td><td>1.00</td><td>0.00</td><td>0.4501</td><td>-</td><td>-</td><td>3824 B</td> | ||
</tr><tr><td>Improved</td><td>1</td><td>lorem(...)oot!! [40]</td><td>3,924.9 ns</td><td>7.03 ns</td><td>5.87 ns</td><td>0.94</td><td>0.00</td><td>0.3967</td><td>-</td><td>-</td><td>3360 B</td> | ||
</tr></tbody></table> | ||
</body> | ||
</html> |
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,55 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Running; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Slugify.Core.Benchmarks | ||
{ | ||
internal class Program | ||
{ | ||
private static void Main(string[] args) | ||
{ | ||
var summary = BenchmarkRunner.Run<SlugifyBenchmarks>(); | ||
} | ||
} | ||
|
||
[MemoryDiagnoser] | ||
public class SlugifyBenchmarks | ||
{ | ||
private SlugHelper _slugHelper; | ||
|
||
[GlobalSetup] | ||
public void GlobalSetup() | ||
{ | ||
_slugHelper = new SlugHelper(); | ||
} | ||
|
||
[Params(1)] | ||
public int N; | ||
|
||
[Params("Hello", "lorem & ipsome Some Other thing!_ woot!!")] | ||
public string word; | ||
|
||
[Benchmark(Baseline = true)] | ||
public void Baseline() | ||
{ | ||
for (int i = 0; i < N; i++) | ||
{ | ||
_slugHelper.GenerateSlug(word); | ||
} | ||
} | ||
|
||
[Benchmark] | ||
public void Improved() | ||
{ | ||
for (int i = 0; i < N; i++) | ||
{ | ||
_slugHelper.GenerateSlug2(word); | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Slugify.Core.Benchmarks/Slugify.Core.Benchmarks.csproj
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Slugify.Core\Slugify.Core.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