-
-
Notifications
You must be signed in to change notification settings - Fork 963
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
Add new template for "dotnet new benchmark" #1028
Comments
@adamsitnik I like this idea! |
btw the .csproj should be: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$whatUserHasAskedFor</TargetFramework>
<OutputType>Exe</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.1*" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.1*" />
</ItemGroup>
</Project> |
I would like to do this :) |
@CodeTherapist awesome! please let me know if you need anything |
Would it be possible to have template for F# and with more code (i.e. template with examples) like next TheAngryByrd/BenchmarkDotNet.Template#3 ? |
I'd be happy to just port the code I have in that repo to something under here as it will get more love and attention. |
I've written a template or two before and would love to help. Before I get started could you provide some basic information?
|
How can I be of help here? |
@Kavignon we already have a pull request by @CodeTherapist with basic template support: #1044 However, I raised some concerns about the current PR status: #1044 (review) . I think it will be better to continue discussion there and finish the PR. |
@AndreyAkinshin No help needed, thanks - I will finish it this week(end). |
@CodeTherapist awesome, thanks! |
# Conflicts: # docs/articles/guides/toc.yml
@AndreyAkinshin, when would the official template package made available on nuget.org? e.g.
and unofficial packages of BenchmarkDotNet: |
@am11 official template was published a few days ago: https://www.nuget.org/packages/BenchmarkDotNet.Templates/ |
I just marked my github repo as archived and my nuget package as deprecated. |
@TheAngryByrd great, thanks! |
Thank you @AndreyAkinshin! 🎉 [maybe not a huge deal but..] Click to expand--- a/Benchmarks.cs
+++ b/Benchmarks.cs
using System;
using BenchmarkDotNet;
using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Running;
namespace Sample
{
+ class Program
+ {
+ static void Main() => BenchmarkRunner.Run<Benchmarks>();
+ }
+
public class Benchmarks
{
[Benchmark]
--- a/Sample.csproj
+++ b/Sample.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
+ <TargetFramework>netcoreapp3.0</TargetFramework>
+ <OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget> So the getting started steps would look like: dotnet new benchmark --name Sample
cd Sample
dotnet run |
there's a CLI flag for that with the template
I know I missed it the first time. I could argue for it being the default too :) |
Thanks @am11 and @TheAngryByrd for your feedback and question. I'm happy to help.
Alternatively, you could install and use the the global BenchmarkDotNet tool and invoke the benchmarks from the CLI (docs). BenchmarkDotnet will strengthen it's integration with leading IDE's in the future to provide better user experience and workflow - similiar to unit tests. |
Great! Thanks for your help and documentation. 👍 |
I think that we should add a new template for dotnet cli that would create following app when used:
@AndreyAkinshin what do you think?
The text was updated successfully, but these errors were encountered: