-
-
Notifications
You must be signed in to change notification settings - Fork 948
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
BenchmarkSwitcher should support generic types with parameterless public ctors #652
Comments
LGTM |
Done! @nietras @xoofx guys you might be interested in updating to static void Main(string[] args)
=> BenchmarkSwitcher.FromTypes
(
new[]
{
typeof(Json_ToString<LoginViewModel>),
typeof(Json_ToString<Location>),
typeof(Json_ToString<IndexViewModel>),
typeof(Json_ToStream<LoginViewModel>),
typeof(Json_ToStream<Location>),
typeof(Json_ToStream<IndexViewModel>),
typeof(Json_FromString<LoginViewModel>),
typeof(Json_FromString<Location>),
typeof(Json_FromString<IndexViewModel>),
typeof(Json_FromStream<LoginViewModel>),
typeof(Json_FromStream<Location>),
typeof(Json_FromStream<IndexViewModel>),
}
)
.Run(args, new BenchmarkConfig()); |
Nice!
…On Feb 19, 2018 17:03, "Adam Sitnik" ***@***.***> wrote:
Done! @nietras <https://github.com/nietras> @xoofx
<https://github.com/xoofx> guys you might be interested in updating to
0.10.12.443 since it has better generics support (full names are used
everywhere, not Generic`1 thing)
static void Main(string[] args)
=> BenchmarkSwitcher.FromTypes
(
new[]
{
typeof(Json_ToString<LoginViewModel>),
typeof(Json_ToString<Location>),
typeof(Json_ToString<IndexViewModel>),
typeof(Json_ToStream<LoginViewModel>),
typeof(Json_ToStream<Location>),
typeof(Json_ToStream<IndexViewModel>),
typeof(Json_FromString<LoginViewModel>),
typeof(Json_FromString<Location>),
typeof(Json_FromString<IndexViewModel>),
typeof(Json_FromStream<LoginViewModel>),
typeof(Json_FromStream<Location>),
typeof(Json_FromStream<IndexViewModel>),
}
)
.Run(args, new BenchmarkConfig());
[image: image]
<https://user-images.githubusercontent.com/6011991/36386540-5a40e7e2-1596-11e8-8238-5494eeef0bd0.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#652 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKTG79LMqoruzkTUfQHiKY5ArA9OSDFrks5tWZtLgaJpZM4SJAxp>
.
|
Amazing, thanks @adamsitnik! |
18 tasks
alinasmirnova
pushed a commit
to alinasmirnova/BenchmarkDotNet
that referenced
this issue
Sep 22, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible to run generic benchmarks via
BenchmarkRunner.Run<T>
but not viaBenchmarkSwitcher.FromTypes
Case: I am currently benchmarking the serializers. I don't want to create new class per type.
@AndreyAkinshin to prevent some bugs I am going to add a requirement: generics are ok if the type has a public parameterless ctor.
The text was updated successfully, but these errors were encountered: