Skip to content

1802 - Disabling overhead calculation#3007

Open
ladeak wants to merge 3 commits intodotnet:masterfrom
ladeak:ladeak-1802-02
Open

1802 - Disabling overhead calculation#3007
ladeak wants to merge 3 commits intodotnet:masterfrom
ladeak:ladeak-1802-02

Conversation

@ladeak
Copy link

@ladeak ladeak commented Feb 14, 2026

  • Overhead evaluation is disabled by default, but the corresponding code is not yet removed.
  • Obsolete attribute added to WithEvaluateOverhead

Closes #1802

- Overhead evaluation is disabled by default, but the corresponding code is not yet removed.
- Obsolete attribute added to WithEvaluateOverhead
@@ -10,7 +10,9 @@ namespace BenchmarkDotNet.Attributes
[PublicAPI]
public class EvaluateOverheadAttribute : JobMutatorConfigBaseAttribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should also be deprecated (you can remove the pragma when that's done).

Copy link
Author

Choose a reason for hiding this comment

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

I will do so.

Copy link
Author

Choose a reason for hiding this comment

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

Updated, also added a few more pragma warnings for the tests failing, so it should build correctly.

return Array.Empty<Summary>();
}

#pragma warning disable CS0618 // WithEvaluateOverhead is obsolete
Copy link
Collaborator

@timcassell timcassell Feb 15, 2026

Choose a reason for hiding this comment

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

Only put the pragmas around the line with the obsolete call.

Copy link
Author

@ladeak ladeak Feb 15, 2026

Choose a reason for hiding this comment

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

I don't think I can do that in this fluent syntax (it was my intention as you suggest here):

image

Would you prefer to refactor the syntax? Or is there another trick?


int iterationCount = baselineJob.Run.IterationCount;
BenchmarkRunInfo[] benchmarksWithoutInvocationCount = TypeFilter.Filter(effectiveConfig, benchmarksToFilter);
#pragma warning disable CS0618 // WithEvaluateOverhead is obsolete
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same

ladeak and others added 2 commits February 15, 2026 10:02
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.

Inaccurate results reported for small methods

2 participants