Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
benchmarks, refine labels
Browse files Browse the repository at this point in the history
  • Loading branch information
pomma89 committed Apr 9, 2017
1 parent 8524a01 commit 368f949
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class MemoryStreamPooling
private readonly IObjectPool<PooledMemoryStream> _objectPool = Specialized.MemoryStreamPool.Instance;
private readonly Microsoft.IO.RecyclableMemoryStreamManager _recManager = new Microsoft.IO.RecyclableMemoryStreamManager();

[Benchmark]
[Benchmark(Baseline = true)]
public long MemoryStreamPool()
{
long l;
Expand Down
2 changes: 1 addition & 1 deletion test/CodeProject.ObjectPool.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Config : ManualConfig
public Config()
{
Add(Job.RyuJitX64);
Add(CsvExporter.Default, HtmlExporter.Default, MarkdownExporter.GitHub, PlainExporter.Default, CsvMeasurementsExporter.Default, RPlotExporter.Default);
Add(PlainExporter.Default, MarkdownExporter.GitHub, CsvExporter.Default, CsvMeasurementsExporter.Default, RPlotExporter.Default);
Add(new MemoryDiagnoser());
Add(EnvironmentAnalyser.Default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ private sealed class MyOriginalResource : Original.PooledObject
[Params(10, 100, 1000)]
public int Count { get; set; }

[Benchmark]
public ParallelLoopResult SimpleObjectPool() => Parallel.For(0, Count, _ =>
[Benchmark(Baseline = true)]
public ParallelLoopResult Simple() => Parallel.For(0, Count, _ =>
{
string str;
using (var x = _objectPool.GetObject())
Expand All @@ -70,7 +70,7 @@ public ParallelLoopResult SimpleObjectPool() => Parallel.For(0, Count, _ =>
});

[Benchmark]
public ParallelLoopResult ParameterizedObjectPool() => Parallel.For(0, Count, _ =>
public ParallelLoopResult Parameterized() => Parallel.For(0, Count, _ =>
{
string str;
using (var x = _paramObjectPool.GetObject(21))
Expand All @@ -80,7 +80,7 @@ public ParallelLoopResult ParameterizedObjectPool() => Parallel.For(0, Count, _
});

[Benchmark]
public ParallelLoopResult MicrosoftObjectPool() => Parallel.For(0, Count, _ =>
public ParallelLoopResult Microsoft() => Parallel.For(0, Count, _ =>
{
MyResource res = null;
string str;
Expand All @@ -99,7 +99,7 @@ public ParallelLoopResult MicrosoftObjectPool() => Parallel.For(0, Count, _ =>
});

[Benchmark]
public ParallelLoopResult OriginalObjectPool() => Parallel.For(0, Count, _ =>
public ParallelLoopResult Original() => Parallel.For(0, Count, _ =>
{
string str;
using (var x = _originalObjectPool.GetObject())
Expand Down
10 changes: 5 additions & 5 deletions test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ private sealed class MyOriginalResource : Original.PooledObject
public string Value { get; set; }
}

[Benchmark]
public string SimpleObjectPool()
[Benchmark(Baseline = true)]
public string Simple()
{
string str;
using (var x = _objectPool.GetObject())
Expand All @@ -67,7 +67,7 @@ public string SimpleObjectPool()
}

[Benchmark]
public string ParameterizedObjectPool()
public string Parameterized()
{
string str;
using (var x = _paramObjectPool.GetObject(21))
Expand All @@ -78,7 +78,7 @@ public string ParameterizedObjectPool()
}

[Benchmark]
public string MicrosoftObjectPool()
public string Microsoft()
{
MyResource res = null;
string str;
Expand All @@ -98,7 +98,7 @@ public string MicrosoftObjectPool()
}

[Benchmark]
public string OriginalObjectPool()
public string Original()
{
string str;
using (var x = _originalObjectPool.GetObject())
Expand Down

0 comments on commit 368f949

Please sign in to comment.