Repository navigation
[Benchmarks] Profile RevitApiBenchmark benchmarks with dotTrace - #65
Merged
Merged
Conversation
4 tasks
There was a problem hiding this comment.
🔵 Needs a closer look
Reported profiling runs used a project reference, leaving the shipped ILRepack-merged injector unvalidated in Revit across both CLR families.
No open issues 🎉
What changed in this PR
This PR enables dotTrace attachment to Revit API benchmark processes through an injector update and a .NET Framework runtime setting applied by the benchmark host.
Changes:
- Updates injector packages for Revit 2021–2027.
- Enables the .NET Framework profiler attach thread through an inherited environment variable.
- Shares host-process detection between profiler setup and RevitAPIUI metadata resolution.
| File | Description |
|---|---|
source/Nice3point.BenchmarkDotNet.Revit/RevitApplicationBenchmark.cs |
Calls profiler setup during initialization and documents it. |
source/Nice3point.BenchmarkDotNet.Revit/Hosting/RevitUiMetadataResolver.cs |
Uses shared host-process detection. |
source/Nice3point.BenchmarkDotNet.Revit/Hosting/ProfilerAttachThread.cs |
Sets the profiler attach environment variable in .NET Framework hosts. |
source/Nice3point.BenchmarkDotNet.Revit/Hosting/BenchmarkHostProcess.cs |
Centralizes host-process identification. |
Directory.Packages.props |
Updates Revit injector dependencies to the profiling-compatible releases. |
Review effort: Balanced
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 of the Pull Request
What is this about:
The dotTrace profiler attaches to the process of a
RevitApiBenchmarkbenchmark on every supported Revit version.Description:
What changed
2021.1.11–2026.1.11for Revit 2021–2026, and2027.0.11for Revit 2027. Its console filter runs no managed code.COMPlus_AttachThreadAlwaysOn=1, and the benchmark processes inherit it.BenchmarkHostProcess.IsCurrentidentifies the host process for the RevitAPIUI metadata resolver and the attach thread.Where to look
How verified
Build:
Release.R21toRelease.R27, zero warnings, zero errors.AddDiagnoser(new DotTraceDiagnoser())inProgram.cs,ApplicationBenchmarksandSelectionBenchmarksin one run, a Dry job:ApplicationBenchmarksSelectionBenchmarks2027.0.102027.0.112025.1.112024.1.11, without the settingCan't attach CLR profiler2024.1.11, this branchQuality Checklist