Skip to content

Instantly share code, notes, and snippets.

@adamsitnik
Created February 3, 2016 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamsitnik/c7167a340b1f4be76bbf to your computer and use it in GitHub Desktop.
Save adamsitnik/c7167a340b1f4be76bbf to your computer and use it in GitHub Desktop.
benchmarkconfiguration
[Config(jit: JitVersion.Legacy)]
[Config(framework: Framework.V35 | Framework.V45)]
public class SampleBenchmark
{
}
[Flags]
public enum JitVersion
{
Host = 0,
Legacy = 1 << 0,
Ryu = 1 << 1,
All = Legacy | Ryu
}
[Flags]
public enum Architecture
{
Host = 0,
AnyCpu = 1 << 0,
x64 = 1 << 1,
x86 = 1 << 2,
All = x64 | x86
}
[Flags]
public enum Framework
{
Host = 0,
V35 = 1 << 0,
V40 = 1 << 1,
V45 = 1 << 2,
V451 = 1 << 3,
V452 = 1 << 4,
V46 = 1 << 5
}
public enum Mode
{
Throughput = 0,
SingleRun = 1
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class ConfigAttribute : Attribute
{
public ConfigAttribute(
Mode mode = Mode.Throughput,
JitVersion jit = JitVersion.Host,
Architecture platform = Architecture.Host,
Framework framework = Framework.Host)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment