Skip to content

[Docs][Tests] Profile the transaction benchmarks with dotTrace - #63

Merged
Nice3point merged 4 commits into
developfrom
docs/61-profile-with-dottrace
Nov 1, 2026
Merged

Nice3point merged 4 commits into
developfrom
docs/61-profile-with-dottrace

Conversation

@Nice3point

@Nice3point Nice3point commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary of the Pull Request

What is this about:

The README and the benchmark project show how to profile the benchmarks with dotTrace.

Description:

What changed

  • The DotTrace profiler section of the README adds DotTraceDiagnoser to the configuration in Program.cs, and names the [DotTraceDiagnoser] attribute for a single class.
  • The changelog of the release has a DotTrace profiler section with the same configuration.
  • The benchmark project references BenchmarkDotNet.Diagnostics.dotTrace 0.15.8.
  • TransactionBenchmarks sets the comment of 100 walls in one transaction and in a transaction per wall, with [DotTraceDiagnoser] on the class.

Where to look

  • OnGlobalCleanup saves the document. The API closes no active document: Close(false) throws "The active document may not be closed from the API". An unsaved document shows the save dialog when Revit exits.
  • Each invocation writes a new comment. A transaction that sets an unchanged value would commit no change.
  • The model has 100 walls. With 1000 walls, an invocation takes 1.7 s and 5 s, and the default job with the profiling run takes several minutes per benchmark.
  • The README section covers RevitApiBenchmark classes, which profile only with the fix of [Benchmarks] Profile RevitApiBenchmark benchmarks with dotTrace #65.

How verified

  • Build: Release.R21 to Release.R27, zero warnings, zero errors.

  • TransactionBenchmarks:

    Revit Runtime Job SetCommentsInOneTransaction SetCommentsInTransactionPerWall Snapshots
    2027 .NET 10 Default 48.24 ms ± 0.93 ms, 72 KB 332.45 ms ± 7.45 ms, 1679 KB 2
    2027 .NET 10 ShortRun, with the cleanup 47.17 ms ± 0.43 ms 341.38 ms ± 5.80 ms 2
    2024 .NET Framework 4.8 ShortRun, with the cleanup 41.22 ms ± 0.27 ms 285.39 ms ± 1.48 ms 2
  • With the cleanup, Revit exited 16 s after the end of the run, without the 30 s timeout that ends a Revit process held by a dialog.

Quality Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@Nice3point Nice3point added documentation 📃 README, wiki, or XML documentation change benchmarks 📊 Benchmark runner and its configuration labels Nov 1, 2026
@Nice3point Nice3point self-assigned this Nov 1, 2026
@Nice3point
Nice3point marked this pull request as ready for review November 1, 2026 15:31
Copilot AI balanced review requested due to automatic review settings November 1, 2026 15:31
@Nice3point
Nice3point merged commit cce7e10 into develop Nov 1, 2026
1 check passed
@Nice3point
Nice3point deleted the docs/61-profile-with-dottrace branch November 1, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The profiling guidance depends on still-open PR #65, leaving merge ordering, integration of its injector/runtime fixes, and combined validation on .NET Framework and modern Revit/.NET unresolved.

No open issues 🎉

What changed in this PR

Adds dotTrace profiling guidance and a runnable transaction benchmark example for the Revit benchmark library, complementing the profiling support in PR #65.

Changes:

  • Documents global and per-class dotTrace configuration in the README and changelog.
  • Adds the dotTrace diagnostics dependency at version 0.15.8.
  • Compares updating 100 walls in one transaction versus one transaction per wall, saving the document during cleanup.
File Description
tests/​Nice3point.BenchmarkDotNet.Revit.Benchmarks/​TransactionBenchmarks.cs Adds profiled transaction comparisons with model setup and cleanup.
tests/​Nice3point.BenchmarkDotNet.Revit.Benchmarks/​Nice3point.BenchmarkDotNet.Revit.Benchmarks.csproj References the dotTrace diagnostics package.
README.md Explains global and per-class profiling configuration.
Directory.Packages.props Pins dotTrace diagnostics to version 0.15.8.
CHANGELOG.md Records profiling support and configuration examples.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarks 📊 Benchmark runner and its configuration documentation 📃 README, wiki, or XML documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants