Browse Source

Benchmark running on linux

Script for benchmarks

Fix from cherry-picking

CPU governor not necessary
af/merge-core
Toxantron 9 years ago
parent
commit
784ded5ce0
  1. 7
      .vscode/tasks.json
  2. 4
      global.json
  3. 5
      tests/ImageSharp.Benchmarks/Program.cs
  4. 7
      tests/ImageSharp.Benchmarks/benchmark.sh
  5. 14
      tests/ImageSharp.Benchmarks/project.json

7
.vscode/tasks.json

@ -13,6 +13,13 @@
"showOutput": "always",
"problemMatcher": "$msCompile"
},
{
"taskName": "build benchmark",
"suppressTaskName": true,
"args": [ "build", "tests/ImageSharp.Benchmarks/project.json", "-f", "netcoreapp1.1", "-c", "Release" ],
"showOutput": "always",
"problemMatcher": "$msCompile"
},
{
"taskName": "test",
"args": ["tests/ImageSharp.Tests/project.json", "-f", "netcoreapp1.1"],

4
global.json

@ -1,6 +1,6 @@
{
"projects": [ "src" ],
"sdk": {
"projects": [ "src", "tests" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
}

5
tests/ImageSharp.Benchmarks/Program.cs

@ -6,8 +6,9 @@
namespace ImageSharp.Benchmarks
{
using BenchmarkDotNet.Running;
using ImageSharp.Formats;
using System.Reflection;
public class Program
{
@ -19,7 +20,7 @@ namespace ImageSharp.Benchmarks
/// </param>
public static void Main(string[] args)
{
new BenchmarkSwitcher(typeof(Program).Assembly).Run(args);
new BenchmarkSwitcher(typeof(Program).GetTypeInfo().Assembly).Run(args);
}
}
}

7
tests/ImageSharp.Benchmarks/benchmark.sh

@ -0,0 +1,7 @@
#!/bin/bash
# Build in release mode
dotnet build -c Release -f netcoreapp1.1
# Run benchmarks
dotnet bin/Release/netcoreapp1.1/ImageSharp.Benchmarks.dll

14
tests/ImageSharp.Benchmarks/project.json

@ -14,7 +14,6 @@
"allowUnsafe": true
},
"dependencies": {
"BenchmarkDotNet.Diagnostics.Windows": "0.10.1",
"ImageSharp": {
"target": "project"
},
@ -46,10 +45,23 @@
"frameworks": {
"net46": {
"dependencies": {
"BenchmarkDotNet.Diagnostics.Windows": "0.10.1"
},
"frameworkAssemblies": {
"System.Drawing": ""
}
},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-*"
},
"BenchmarkDotNet": "0.10.2",
"CoreCompat.System.Drawing": "1.0.0-beta006",
"runtime.linux-x64.CoreCompat.System.Drawing": "1.0.0-beta009",
"System.Reflection": "4.3.0"
}
}
}
}

Loading…
Cancel
Save