FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CSharpMath/CSharpMath.Rendering.Benchmarks/Program.cs at master · verybadcat/CSharpMath · GitHub
verybadcat
/
CSharpMath
Public
Notifications
You must be signed in to change notification settings
Fork
78
Star
449
Code
Issues
39
Pull requests
4
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CSharpMath
/
CSharpMath.Rendering.Benchmarks
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (43 loc) · 2.15 KB
Breadcrumbs
CSharpMath
/
CSharpMath.Rendering.Benchmarks
/
Program.cs
Copy path
File metadata and controls
44 lines (43 loc) · 2.15 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
using
BenchmarkDotNet
.
Attributes
;
namespace
CSharpMath
.
Rendering
.
Benchmarks
{
using
SkiaSharp
;
using
Data
=
Tests
.
TestRenderingMathData
;
public
class
Program
{
// In Windows, selecting text inside the Visual Sutdio Debug console pauses program execution.
// A simple press of the spacebar continues program execution, so don't be fooled into thinking it hanged!
// Place a long benchmark before microbenchmarks to work around https://github.com/dotnet/BenchmarkDotNet/issues/1338
[
Benchmark
]
public
void
AllConstantValues
(
)
{
using
(
new
MathPainter
{
LaTeX
=
Data
.
AllConstantValues
}
.
DrawAsStream
(
)
)
{
}
}
[
Benchmark
]
[
Arguments
(
nameof
(
Data
.
Cases
)
)
]
[
Arguments
(
nameof
(
Data
.
Color
)
)
]
[
Arguments
(
nameof
(
Data
.
Commands
)
)
]
[
Arguments
(
nameof
(
Data
.
Cyrillic
)
)
]
[
Arguments
(
nameof
(
Data
.
ErrorMissingArgument
)
)
]
[
Arguments
(
nameof
(
Data
.
Matrix
)
)
]
[
Arguments
(
nameof
(
Data
.
QuadraticFormula
)
)
]
[
Arguments
(
nameof
(
Data
.
QuarticSolutions
)
)
]
[
Arguments
(
nameof
(
Data
.
TangentPeriodShift
)
)
]
[
Arguments
(
nameof
(
Data
.
VectorProjection
)
)
]
public
void
IndividualTests
(
string
key
)
{
using
(
new
MathPainter
{
LaTeX
=
Data
.
AllConstants
[
key
]
}
.
DrawAsStream
(
)
)
{
}
}
static
void
Main
(
string
[
]
args
)
{
#if
DEBUG
System
.
Console
.
WriteLine
(
"Starting in Debug configuration..."
)
;
static
string
ThisFile
(
[
System
.
Runtime
.
CompilerServices
.
CallerFilePath
]
string
path
=
""
)
=>
path
;
var
p
=
new
System
.
Diagnostics
.
Process
{
StartInfo
=
{
FileName
=
"dotnet"
,
// The -- separator between arguments to dotnet and arguments to this Program is optional :)
Arguments
=
$
"run -p
\"
{
ThisFile
(
)
}
/../CSharpMath.Rendering.Benchmarks.csproj
\"
-c Release -v n --exporters json --filter * --artifacts
\"
{
ThisFile
(
)
}
/../../.benchmarkresults
\"
"
}
}
;
p
.
Start
(
)
;
p
.
WaitForExit
(
)
;
System
.
Console
.
WriteLine
(
"Ending in Debug configuration..."
)
;
#else
System
.
Console
.
WriteLine
(
"Starting in Release configuration..."
)
;
BenchmarkDotNet
.
Running
.
BenchmarkSwitcher
.
FromAssembly
(
typeof
(
Program
)
.
Assembly
)
.
Run
(
args
)
;
System
.
Console
.
WriteLine
(
"Ending in Release configuration..."
)
;
#endif
}
}
}
Back
|
FazBrowse Home
|
New Git URL