Skip to content

feat: Add UseLocalJobOnlyAttribute and modify related codes#3050

Open
filzrev wants to merge 3 commits intodotnet:masterfrom
filzrev:feat-add-attribute-uselocaljobonly
Open

feat: Add UseLocalJobOnlyAttribute and modify related codes#3050
filzrev wants to merge 3 commits intodotnet:masterfrom
filzrev:feat-add-attribute-uselocaljobonly

Conversation

@filzrev
Copy link
Copy Markdown
Contributor

@filzrev filzrev commented Mar 13, 2026

This PR contains following changes.

  1. Add UseLocalJobOnlyAttribute
  2. Add ConfigUnionRule.UnionAndUseLocalJob
  3. Modify BenchmarkConverter.cs code to handle UnionAndUseLocalJobAttribute.
  4. Modify samples benchmarks that using local jobs.

Background
When using global config that contains jobs and benchmark local config also jobs.
Both jobs that are defined by global/local config are executed.
(e,g, When using DebugInProcessConfig as global config. and benchmark has attributes also define jobs)

This PR intended to exclude unnecessary jobs that defined by global config.

@filzrev filzrev force-pushed the feat-add-attribute-uselocaljobonly branch from b8e5b3e to d66b773 Compare March 13, 2026 11:01
@fuguiKz
Copy link
Copy Markdown
Contributor

fuguiKz commented Mar 23, 2026

Nice addition — I like the intent (let per-type attributes control the jobs, without global/assembly jobs leaking in), and aggregating type attributes into a single config avoids any attribute-ordering surprises.

A couple small suggestions:

  • Could we add a unit test to lock in the new ConfigUnionRule.UnionAndUseLocalJob behavior (e.g., global config has jobs + other settings; local config has jobs; expect union keeps global non-job settings but uses only the local jobs)?
  • Minor: the InvalidBenchmarkDeclarationException message has a couple typos and could include which attribute set a non-default UnionRule to make it more actionable.
  • Optional: if this is meant for end users too (not just samples), it might be worth a short doc note about when to use UseLocalJobOnlyAttribute / UnionAndUseLocalJob.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants