diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 8276be16b..fc9312f58 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -72,5 +72,10 @@ jobs:
- name: Python tests run from .NET
run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/
- # TODO: Run perf tests
+ - name: Perf tests
+ if: ${{ matrix.python == '3.8' }}
+ run: |
+ pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
+ dotnet test --configuration Release --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/perf_tests/
+
# TODO: Run mono tests on Windows?
diff --git a/.gitignore b/.gitignore
index cdb152157..6159b1b14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/src/runtime/interopNative.cs
+/src/perf_tests/baseline/
# General binaries and Build results
*.dll
diff --git a/src/perf_tests/BaselineComparisonBenchmarkBase.cs b/src/perf_tests/BaselineComparisonBenchmarkBase.cs
index 2388e3982..06adcbc67 100644
--- a/src/perf_tests/BaselineComparisonBenchmarkBase.cs
+++ b/src/perf_tests/BaselineComparisonBenchmarkBase.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
@@ -17,8 +18,7 @@ public BaselineComparisonBenchmarkBase()
try {
PythonEngine.Initialize();
Console.WriteLine("Python Initialized");
- if (PythonEngine.BeginAllowThreads() == IntPtr.Zero)
- throw new PythonException();
+ Trace.Assert(PythonEngine.BeginAllowThreads() != IntPtr.Zero);
Console.WriteLine("Threading enabled");
}
catch (Exception e) {
@@ -28,6 +28,11 @@ public BaselineComparisonBenchmarkBase()
}
static BaselineComparisonBenchmarkBase()
+ {
+ SetupRuntimeResolve();
+ }
+
+ public static void SetupRuntimeResolve()
{
string pythonRuntimeDll = Environment.GetEnvironmentVariable(BaselineComparisonConfig.EnvironmentVariableName);
if (string.IsNullOrEmpty(pythonRuntimeDll))
diff --git a/src/perf_tests/BaselineComparisonConfig.cs b/src/perf_tests/BaselineComparisonConfig.cs
index 649bb56fd..3f6766554 100644
--- a/src/perf_tests/BaselineComparisonConfig.cs
+++ b/src/perf_tests/BaselineComparisonConfig.cs
@@ -5,7 +5,8 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
-using BenchmarkDotNet.Horology;
+
+using Perfolizer.Horology;
namespace Python.PerformanceTests
{
diff --git a/src/perf_tests/BenchmarkTests.cs b/src/perf_tests/BenchmarkTests.cs
index 6e0afca69..9e033d11f 100644
--- a/src/perf_tests/BenchmarkTests.cs
+++ b/src/perf_tests/BenchmarkTests.cs
@@ -30,14 +30,14 @@ public void SetUp()
public void ReadInt64Property()
{
double optimisticPerfRatio = GetOptimisticPerfRatio(this.summary.Reports);
- AssertPerformanceIsBetterOrSame(optimisticPerfRatio, target: 0.57);
+ AssertPerformanceIsBetterOrSame(optimisticPerfRatio, target: 1.35);
}
[Test]
public void WriteInt64Property()
{
double optimisticPerfRatio = GetOptimisticPerfRatio(this.summary.Reports);
- AssertPerformanceIsBetterOrSame(optimisticPerfRatio, target: 0.57);
+ AssertPerformanceIsBetterOrSame(optimisticPerfRatio, target: 1.25);
}
static double GetOptimisticPerfRatio(
diff --git a/src/perf_tests/Python.PerformanceTests.csproj b/src/perf_tests/Python.PerformanceTests.csproj
index 22783e595..bde07ecab 100644
--- a/src/perf_tests/Python.PerformanceTests.csproj
+++ b/src/perf_tests/Python.PerformanceTests.csproj
@@ -3,11 +3,25 @@
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: