Comments (4)
yeah, I need to give [Params]
a bit more love, it's too basic at the moment, but I just wanted to get something out there.
I agree, do you mean something like this:
[Params(typeof(ParamsData))]
public int Size = 1;
public class ParamsData : IEnumerable<int>
{
public IEnumerator<int> GetEnumerator()
{
// Create the IEnumerable<int> however you want
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
also I was thinking of adding this, what do you think?
[ParamsWithSteps(start: 1, end: 1000, step: 10)]
public int Size = 1;
which would basically do the following:
for (int i = 1, i <= 1000; i += 10)
{
// run benchmark with Size = i
}
from benchmarkdotnet.
I would go with a simplier interface with a method that returns IEnumerable<T>
but yeah, that's the idea.
With ParamsWithSteps I would go further and support inheritance and provide a few examples like:
[ParamsWithStep(start: 1, end: 1000, step: 10, inclusive: true)
[ParamsQuadratic(start: 1, end: 1000, inclusive: false)
[ParamsPowerOf(start: 1, end: 1024, power: 2, inclusive: true)
from benchmarkdotnet.
I would go with a simplier interface with a method that returns
IEnumerable<T>
but yeah, that's the idea.
Yeah I agree, I've just seen that XUnit simplified everything, so you can now support method/fields or classes via [MemberData(..)]
, see https://xunit.codeplex.com/SourceControl/changeset/628af664e521543c2c9d712b45d0d870f2a84d26
With ParamsWithSteps I would go further and support inheritance and provide a few examples like:
Nice idea, I'd not thought about Quadratic/PowerOf
from benchmarkdotnet.
It will be tracked as part of #256
from benchmarkdotnet.
Related Issues (20)
- Support for F# anonymous records HOT 3
- MonoAOTLLVM run failed to build properly but still ran HOT 2
- Add integration tests for `MonoAOTLLVMToolchain`
- Unable to get `-p ETW` working these days HOT 4
- Unable to use `wasm` or `monoaotllvm` as runtime HOT 2
- InvalidMeasurementUnitException when using `--statisticalTest` argument when comparing private builds HOT 2
- CS0119 thrown when benchmark named _.System()
- How to change the time display mode from microseconds to seconds or milliseconds? HOT 1
- HideColumns + custom corerun = incorrect table markdown HOT 2
- unity game engine support? HOT 1
- Cannot build NativeAOT 8.0 on Arch Linux HOT 6
- Add support for dotnet-script HOT 1
- What should I do if I need to see the output of each test item? HOT 2
- What should I do if I need to see the output of each test item? HOT 1
- Plots not generated for memory benchmarks (MemoryDiagnoser)
- Question about visibility of DotTraceDiagnoser's second constructor HOT 2
- BenchmarkDotNet does not copy needed assemblies to the run folder (again?) HOT 2
- Can't override `DefaultConfig.Instance` settings when using custom configs with `IConfigSource` attribute.
- Better support for asymmetric CPU cores HOT 3
- Total Number of Benchmarks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from benchmarkdotnet.