FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/perf_tests/BaselineComparisonConfig.cs at master · sdpython/pythonnet · GitHub
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
sdpython
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
perf_tests
/
BaselineComparisonConfig.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (45 loc) · 1.91 KB
Breadcrumbs
pythonnet
/
src
/
perf_tests
/
BaselineComparisonConfig.cs
Copy path
File metadata and controls
52 lines (45 loc) · 1.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
IO
;
using
System
.
Reflection
;
using
BenchmarkDotNet
.
Configs
;
using
BenchmarkDotNet
.
Jobs
;
using
BenchmarkDotNet
.
Horology
;
namespace
Python
.
PerformanceTests
{
public
class
BaselineComparisonConfig
:
ManualConfig
{
public
const
string
EnvironmentVariableName
=
"PythonRuntimeDLL"
;
public
BaselineComparisonConfig
(
)
{
this
.
Options
|=
ConfigOptions
.
DisableOptimizationsValidator
;
string
deploymentRoot
=
BenchmarkTests
.
DeploymentRoot
;
var
baseJob
=
Job
.
Default
.
WithLaunchCount
(
1
)
.
WithWarmupCount
(
3
)
.
WithMaxIterationCount
(
100
)
.
WithIterationTime
(
TimeInterval
.
FromMilliseconds
(
100
)
)
;
this
.
Add
(
baseJob
.
WithId
(
"baseline"
)
.
WithEnvironmentVariable
(
EnvironmentVariableName
,
Path
.
Combine
(
deploymentRoot
,
"baseline"
,
"Python.Runtime.dll"
)
)
.
WithBaseline
(
true
)
)
;
this
.
Add
(
baseJob
.
WithId
(
"new"
)
.
WithEnvironmentVariable
(
EnvironmentVariableName
,
Path
.
Combine
(
deploymentRoot
,
"new"
,
"Python.Runtime.dll"
)
)
)
;
}
static
BaselineComparisonConfig
(
)
{
AppDomain
.
CurrentDomain
.
AssemblyResolve
+=
CurrentDomainOnAssemblyResolve
;
}
static
Assembly
CurrentDomainOnAssemblyResolve
(
object
sender
,
ResolveEventArgs
args
)
{
Console
.
WriteLine
(
args
.
Name
)
;
if
(
!
args
.
Name
.
StartsWith
(
"Python.Runtime"
)
)
return
null
;
string
pythonRuntimeDll
=
Environment
.
GetEnvironmentVariable
(
EnvironmentVariableName
)
;
if
(
string
.
IsNullOrEmpty
(
pythonRuntimeDll
)
)
pythonRuntimeDll
=
Path
.
Combine
(
BenchmarkTests
.
DeploymentRoot
,
"baseline"
,
"Python.Runtime.dll"
)
;
return
Assembly
.
LoadFrom
(
pythonRuntimeDll
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL