Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PERF] Finish fixing PerfBDNApp, continuation of #89057 #89135

Merged
merged 7 commits into from
Jul 20, 2023
23 changes: 15 additions & 8 deletions eng/pipelines/coreclr/templates/build-perf-bdn-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,21 @@ steps:
displayName: Clone Maui
workingDirectory: $(Build.SourcesDirectory)

- script: |
set -x
pwd
git clone https://github.com/dotnet/performance.git --depth 1 -b ${{parameters.perfRepo}} --single-branch
displayName: Clone performance
workingDirectory: $(Build.SourcesDirectory)

- pwsh: |
$BenchmarkDotNetVersionCapture = Get-Content .\performance\eng\Versions.props | Select-String -Pattern '<BenchmarkDotNetVersion>(.+?)</BenchmarkDotNetVersion>'
if ($BenchmarkDotNetVersionCapture.Length -eq 0) {
Write-Error "BenchmarkDotNetVersion not found in Versions.props"
exit 1
}
$BenchmarkDotNetVersion = $BenchmarkDotNetVersionCapture.Matches.Groups[1].Value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check here also that the match was successful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a check for this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a quick look at this match check an let me know if you have any thoughts on better ways to do the check. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion here. $BenchmarkDotNetVersionCapture.Matches[0].Success or ...Matches.Groups[1].Success might be other option.


$instrumentationFileContent = Get-Content .\maui\src\Core\tests\Benchmarks.Droid\MainInstrumentation.cs
$perfLabExportLine = $instrumentationFileContent | Select-String -Pattern 'using BenchmarkDotNet.Toolchains.InProcess.Emit;'
$lineNumber = $perfLabExportLine.LineNumber
Expand All @@ -100,7 +114,7 @@ steps:

$packageReferenceLine = $benchmarksDroidConfigFileContent | Select-String -Pattern '<PackageReference Include="BenchmarkDotNet"'
$lineNumber = $packageReferenceLine.LineNumber
$benchmarksDroidConfigFileContent[$lineNumber-1] = " <PackageReference Include=`"BenchmarkDotNet`" Version=`"`$(BenchmarkDotNetVersion)`" />"
$benchmarksDroidConfigFileContent[$lineNumber-1] = " <PackageReference Include=`"BenchmarkDotNet`" Version=`"$BenchmarkDotNetVersion`" />"

$projectReferenceLine = $benchmarksDroidConfigFileContent | Select-String -Pattern '<ProjectReference Include="..\\..\\src\\Core.csproj" />'
$lineNumber = $projectReferenceLine.LineNumber
Expand Down Expand Up @@ -131,13 +145,6 @@ steps:
displayName: Insert Target Replace, BDN config link, and PerfLabExporter
workingDirectory: $(Build.SourcesDirectory)

- script: |
set -x
pwd
git clone https://github.com/dotnet/performance.git --depth 1 -b ${{parameters.perfRepo}} --single-branch
displayName: Clone performance
workingDirectory: $(Build.SourcesDirectory)

# Remove the embed assemblies from source
- script: |
../dotnet build ./src/Core/tests/Benchmarks.Droid/Benchmarks.Droid.csproj --configuration Release -bl:BenchmarksDroid.binlog /p:TF_Build=False
Expand Down