Add Android BenchmarkDotNet template#11312
Draft
simonrozsival wants to merge 8 commits into
Draft
Conversation
Adds an Android BenchmarkDotNet project template that runs benchmarks through an instrumentation class on CoreCLR. The template uses BenchmarkDotNet's in-process no-emit toolchain and supports dotnet run argument pass-through for common options such as --filter and --job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8258972 to
9c21329
Compare
Use a dotnet-run scoped argument bundle key and generic artifact messages in Microsoft.Android.Run. Keep BenchmarkDotNet-specific argument parsing in the Android BenchmarkDotNet template instrumentation class. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow the Android BenchmarkDotNet template to select either BenchmarkDotNet in-process toolchain with --toolchain emit|noemit. Keep noemit as the default, and document why Android instrumentation cannot use BenchmarkDotNet's external SDK-based toolchains. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the BenchmarkDotNet package version local to the template, remove the temporary template hive test helper path, and use a single in-process BenchmarkDotNet toolchain default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drain instrumentation output before parsing results, fail runs when reported artifacts cannot be pulled, validate device artifact paths before adb pull, and add focused coverage for instrumentation argument forwarding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document that the Mono.Options <> handler captures forwarded app arguments after dotnet run --, not the delimiter itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment on lines
+49
to
+50
| [Test] | ||
| public void ComputeRunArgumentsForwardsInstrumentationStartArguments () |
Member
There was a problem hiding this comment.
There is also a test that just verifies every project template builds, we might add this new one to the list.
- AndroidBenchmark1.csproj: replace blanket PublishTrimmed=false/PublishReadyToRun=false with TrimmerRootAssembly entries that keep BenchmarkDotNet and the user's own assembly intact while letting the rest of the app trim normally. - Microsoft.Android.Sdk.Application.targets: inline $(StartArguments) directly in RunArguments instead of introducing a dedicated _AndroidRunStartArguments property. Microsoft.Android.Run only accepts positional arguments in --instrument mode and will surface a usage error otherwise. - XASdkTests: add android-benchmarkdotnet to DotNetNew's [Values] so the new template is exercised by the build-every-template fixture, and update ComputeRunArgumentsForwardsInstrumentationStartArguments to match the simplified targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
android-benchmarkdotnetproject template that runs BenchmarkDotNet from an Android instrumentation class on CoreCLRdotnet run -- ...argument pass-through for instrumentation runs, including BenchmarkDotNet--filter/--jobsupport in the templateBenchmarkDotNet.Artifactsback to the working directoryValidation
dotnet build src/Microsoft.Android.Run/Microsoft.Android.Run.csproj -v:minimaldotnet build src/Microsoft.Android.Templates/Microsoft.Android.Templates.csproj -v:minimaldotnet build tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj -v:minimaldotnet build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj --no-dependencies -v:minimalgit diff --checkNote: the new filtered MSBuild device integration test is authored but was not runnable end-to-end in this local worktree because local workload/runtime pack generation is incomplete.