Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c5590f4

Browse files
authored
Enable Linux Performance Runs (#20756)
* Initial work to enable CoreFx perf rolling runs on Linux. * Need to escape the '$' character. * Missing a `./` in front of the `build-managed.sh` * missing sudo prefix. * Fixing typo. * Making `dotnet` executable in order to fix `Permission denied` errors. * Skipping performance test that hangs on Unix. * Bumping version of the xUnit Performance Api. - This version contains a fix that removes the `virtual` call from the InnerIterations getter, thus reducing the overhead around the benchmarks. * Removing unnecessary code from groovy file.
1 parent 4bd63d9 commit c5590f4

File tree

3 files changed

+49
-26
lines changed

3 files changed

+49
-26
lines changed

dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<!-- Full package version strings that are used in other parts of the build. -->
3838
<PropertyGroup>
3939
<AppXRunnerVersion>1.0.3-prerelease-00921-01</AppXRunnerVersion>
40-
<XunitPerfAnalysisPackageVersion>1.0.0-beta-build0003</XunitPerfAnalysisPackageVersion>
40+
<XunitPerfAnalysisPackageVersion>1.0.0-beta-build0007</XunitPerfAnalysisPackageVersion>
4141
<TraceEventPackageVersion>1.0.3-alpha-experimental</TraceEventPackageVersion>
4242
<XunitNetcoreExtensionsVersion>1.0.1-prerelease-01616-05</XunitNetcoreExtensionsVersion>
4343
</PropertyGroup>

perf.groovy

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ def osShortName = ['Windows 10': 'win10',
4949
// **************************
5050
[true, false].each { isPR ->
5151
['Release'].each { configurationGroup ->
52-
['Windows_NT'].each { os ->
52+
['Windows_NT', 'Ubuntu14.04'].each { os ->
5353
def osGroup = osGroupMap[os]
5454
def newJobName = "perf_${os.toLowerCase()}_${configurationGroup.toLowerCase()}"
5555

5656
def newJob = job(Utilities.getFullJobName(project, newJobName, isPR)) {
57-
58-
label('windows_clr_perf')
57+
if (os == 'Windows_NT') {
58+
label('windows_clr_perf')
59+
}
60+
else {
61+
label('linux_clr_perf')
62+
}
63+
5964
wrappers {
6065
credentialsBinding {
6166
string('BV_UPLOAD_SAS_TOKEN', 'CoreFX Perf BenchView Sas')
@@ -69,32 +74,50 @@ def osShortName = ['Windows 10': 'win10',
6974
stringParam('BenchviewCommitName', '\${ghprbPullTitle}', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
7075
}
7176
}
72-
parameters
73-
{
74-
stringParam('XUNIT_PERFORMANCE_MAX_ITERATION', '100', 'Set the maximum number of iterations that a test can execute')
77+
78+
parameters {
79+
stringParam('XUNIT_PERFORMANCE_MAX_ITERATION', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
80+
stringParam('XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
7581
}
82+
7683
def configuration = 'Release'
7784
def runType = isPR ? 'private' : 'rolling'
78-
def benchViewName = isPR ? 'corefx private %BenchviewCommitName%' : 'corefx rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
79-
80-
steps {
81-
//We need to specify the max cpu count to be one as we do not want to be executing performance tests in parallel
82-
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && build.cmd -release")
83-
batchFile("C:\\Tools\\nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"%WORKSPACE%\\Tools\" -Prerelease -ExcludeVersion")
84-
//Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
85-
//we have to do it all as one statement because cmd is called each time and we lose the set environment variable
86-
batchFile("if [%GIT_BRANCH:~0,7%] == [origin/] (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)\n" +
87-
"py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
88-
"py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type " + runType)
89-
batchFile("py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
90-
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && build-managed.cmd -release -tests -- /p:Performance=true /p:TargetOS=Windows_NT /m:1 /p:LogToBenchview=true /p:BenchviewRunType=${runType}")
85+
86+
if (os == 'Windows_NT') {
87+
def benchViewName = isPR ? 'corefx private %BenchviewCommitName%' : 'corefx rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
88+
steps {
89+
//We need to specify the max cpu count to be one as we do not want to be executing performance tests in parallel
90+
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && build.cmd -release")
91+
batchFile("C:\\Tools\\nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"%WORKSPACE%\\Tools\" -Prerelease -ExcludeVersion")
92+
//Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
93+
//we have to do it all as one statement because cmd is called each time and we lose the set environment variable
94+
batchFile("if [%GIT_BRANCH:~0,7%] == [origin/] (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)\n" +
95+
"py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
96+
"py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type " + runType)
97+
batchFile("py \"%WORKSPACE%\\Tools\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
98+
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && build-managed.cmd -release -tests -- /p:Performance=true /p:TargetOS=${osGroup} /m:1 /p:LogToBenchview=true /p:BenchviewRunType=${runType}")
99+
}
91100
}
92-
}
101+
else {
102+
def benchViewName = isPR ? 'corefx private \$BenchviewCommitName' : 'corefx rolling \$GIT_BRANCH_WITHOUT_ORIGIN \$GIT_COMMIT'
103+
steps {
104+
//We need to specify the max cpu count to be one as we do not want to be executing performance tests in parallel
105+
shell("./build.sh -release")
106+
shell("sudo find . -type f -name dotnet | xargs chmod +x")
107+
shell("curl \"http://benchviewtestfeed.azurewebsites.net/nuget/FindPackagesById()?id='Microsoft.BenchView.JSONFormat'\" | grep \"content type\" | sed \"\$ s/.*src=\\\"\\([^\\\"]*\\)\\\".*/\\1/;tx;d;:x\" | xargs curl -o benchview.zip")
108+
shell("unzip -q -o benchview.zip -d \"\${WORKSPACE}/Tools/Microsoft.BenchView.JSONFormat\"")
93109

94-
// Set the label.
95-
newJob.with {
96-
label('windows_clr_perf')
110+
//Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
111+
//we have to do it all as one statement because cmd is called each time and we lose the set environment variable
112+
shell("GIT_BRANCH_WITHOUT_ORIGIN=\$(echo \$GIT_BRANCH | sed \"s/[^/]*\\/\\(.*\\)/\\1 /\")\n" +
113+
"python3.5 \"\${WORKSPACE}/Tools/Microsoft.BenchView.JSONFormat/tools/submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
114+
"python3.5 \"\${WORKSPACE}/Tools/Microsoft.BenchView.JSONFormat/tools/build.py\" git --branch \$GIT_BRANCH_WITHOUT_ORIGIN --type " + runType)
115+
shell("python3.5 \"\${WORKSPACE}/Tools/Microsoft.BenchView.JSONFormat/tools/machinedata.py\"")
116+
shell("sudo -E bash ./build-managed.sh -release -tests -- /p:Performance=true /p:TargetOS=${osGroup} /m:1 /p:LogToBenchview=true /p:BenchviewRunType=${runType}")
117+
}
118+
}
97119
}
120+
98121
// Set up standard options.
99122
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
100123
//Set timeout to non-default
@@ -108,7 +131,7 @@ def osShortName = ['Windows 10': 'win10',
108131
// Add the unit test results
109132
Utilities.addXUnitDotNETResults(newJob, 'bin/**/Perf-*.xml')
110133
def archiveContents = "msbuild.log"
111-
134+
112135
// Add archival for the built data.
113136
Utilities.addArchival(newJob, archiveContents)
114137
// Set up triggers

src/System.IO.Pipes/tests/Performance/Perf.PipeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace System.IO.Pipes.Tests
1010
{
1111
public abstract class Perf_PipeTest : PipeTestBase
1212
{
13-
[Benchmark]
13+
[Benchmark(Skip = "https://github.com/dotnet/corefx/issues/18290")]
1414
[InlineData(1000000)]
1515
[ActiveIssue(18290, TestPlatforms.AnyUnix)]
1616
public async Task ReadWrite(int size)

0 commit comments

Comments
 (0)