-
-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute improvements #1335
Attribute improvements #1335
Conversation
Example log:
|
I've just had to migrate project SevenZipExtractor to .Net Standard If this PR were merged, I would be able to configure my benchmark using the following code:
instead of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, but please remove the AllowMultiple = true
that don't allow for any customization
src/BenchmarkDotNet/Attributes/Jobs/LegacyJitX86JobAttribute.cs
Outdated
Show resolved
Hide resolved
src/BenchmarkDotNet/Attributes/Jobs/LegacyJitX64JobAttribute.cs
Outdated
Show resolved
Hide resolved
@WojciechNagorski ping |
I will fix it. Sorry for late, I was busy. |
…to task-improve-attributes
Quick question on this topic: I'm producing .NET Standard 2.0 projects. Which |
@DaveSkender NetStandard2.0 is not a runtime, but a library target. It is a standard that can be consumed in multiple runtimes, like .Net Framework, .Net (Core), and Unity (not supported in BDN). See the docs for a full list of runtimes that supports the standard version. |
I sort of get that part, and admittedly this has always confused me, but suppose I'm doing multi-targeting: <TargetFrameworks>net6.0;netstandard2.1;</TargetFrameworks> And it produces two DLLs, one for .NET 6.0 and one for .NET Standard 2.1 And now I want to know how they comparatively perform with BenchmarkDotNet, with these attributes: I might just be confusing the purpose of |
Oh I see what you mean. There is an open issue for recompiling for target runtime, which is related, but I'm not sure how you would choose between the net6.0 dll and netstandard2.1 dll in the benchmarks. You could try creating a separate project for each, with each project referencing the different dlls, and the benchmark project referencing both of those projects. I tried that before with my own library, but for different versions (not different frameworks) and got an error which I also mentioned in that issue. So I'm not sure if that will work for you. In any case, you should add your feedback to that issue. |
@DaveSkender you are most likely looking for #1706 |
In #1321 I created example
IntroEventPipeProfiler
which uses the[EventPipeProfiler(EventPipeProfile.CpuSampling)]
attribute. I wanted to mark this class asShortRunJob
. The used profiler requires .Net Core 3.0+ so I wanted to selectRuntimeMoniker
using the[ShortRunJob(RuntimeMoniker.NetCoreApp30)]
attribute in the same way as[DryRunJob(RuntimeMoniker.NetCoreApp30)]
. But I noticed that there is not an appropriate constructor.In this PR I added the following constructors to attributes:
LongRunJobAttribute
,MediumRunJobAttribute
,ShortRunJobAttribute
, andVeryLongRunJobAttribute
.I also added missing the
AttributeUsage
attribute.