Browse Source

Benchmark running on linux

Script for benchmarks

Fix from cherry-picking

CPU governor not necessary
pull/117/head
Toxantron 9 years ago
parent
commit
cceaeb03e6
  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", "showOutput": "always",
"problemMatcher": "$msCompile" "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", "taskName": "test",
"args": ["tests/ImageSharp.Tests/project.json", "-f", "netcoreapp1.1"], "args": ["tests/ImageSharp.Tests/project.json", "-f", "netcoreapp1.1"],

4
global.json

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

5
tests/ImageSharp.Benchmarks/Program.cs

@ -6,8 +6,9 @@
namespace ImageSharp.Benchmarks namespace ImageSharp.Benchmarks
{ {
using BenchmarkDotNet.Running; using BenchmarkDotNet.Running;
using ImageSharp.Formats; using ImageSharp.Formats;
using System.Reflection;
public class Program public class Program
{ {
@ -19,7 +20,7 @@ namespace ImageSharp.Benchmarks
/// </param> /// </param>
public static void Main(string[] args) 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 "allowUnsafe": true
}, },
"dependencies": { "dependencies": {
"BenchmarkDotNet.Diagnostics.Windows": "0.10.1",
"ImageSharp": { "ImageSharp": {
"target": "project" "target": "project"
}, },
@ -46,10 +45,23 @@
"frameworks": { "frameworks": {
"net46": { "net46": {
"dependencies": { "dependencies": {
"BenchmarkDotNet.Diagnostics.Windows": "0.10.1"
}, },
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Drawing": "" "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