Skip to content

Commit 26bd037

Browse files
authored
Merge pull request #163 from filzrev/chore-update-benchmarks
chore: Update benchmarks
2 parents 0124aa0 + 9fa08db commit 26bd037

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

sandbox/CliFrameworkBenchmark/CliFrameworkBenchmark.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
18+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1919
<PackageReference Include="CliFx" Version="2.3.5" />
2020
<PackageReference Include="clipr" Version="1.6.1" />
2121
<PackageReference Include="Cocona" Version="2.2.0" />
@@ -26,7 +26,8 @@
2626
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
2727
<PackageReference Include="PowerArgs" Version="4.0.3" />
2828
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
29-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20071.2" />
29+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
30+
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
3031
</ItemGroup>
3132

3233

sandbox/CliFrameworkBenchmark/Commands/SystemCommandLineCommand.cs

+7-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.CommandLine;
2-
using System.CommandLine.Invocation;
2+
using System.CommandLine.NamingConventionBinder;
33

44
namespace Cocona.Benchmark.External.Commands;
55

@@ -11,18 +11,9 @@ public static int Execute(string[] args)
1111
{
1212
var command = new RootCommand
1313
{
14-
new Option(new[] {"--str", "-s"})
15-
{
16-
Argument = new Argument<string?>()
17-
},
18-
new Option(new[] {"--int", "-i"})
19-
{
20-
Argument = new Argument<int>()
21-
},
22-
new Option(new[] {"--bool", "-b"})
23-
{
24-
Argument = new Argument<bool>()
25-
}
14+
new Option<string?>(new[] {"--str", "-s"}),
15+
new Option<int>(new[] {"--int", "-i"}),
16+
new Option<bool>(new[] {"--bool", "-b"}),
2617
};
2718

2819
command.Handler = CommandHandler.Create(ExecuteHandler);
@@ -33,18 +24,9 @@ public static Task<int> ExecuteAsync(string[] args)
3324
{
3425
var command = new RootCommand
3526
{
36-
new Option(new[] {"--str", "-s"})
37-
{
38-
Argument = new Argument<string?>()
39-
},
40-
new Option(new[] {"--int", "-i"})
41-
{
42-
Argument = new Argument<int>()
43-
},
44-
new Option(new[] {"--bool", "-b"})
45-
{
46-
Argument = new Argument<bool>()
47-
}
27+
new Option<string?>(new[] {"--str", "-s"}),
28+
new Option<int>(new[] {"--int", "-i"}),
29+
new Option<bool>(new[] {"--bool", "-b"}),
4830
};
4931

5032
command.Handler = CommandHandler.Create(ExecuteHandler);

sandbox/CliFrameworkBenchmark/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class Program
1212
{
1313
static void Main(string[] args)
1414
{
15-
BenchmarkRunner.Run<Benchmark>(DefaultConfig.Instance.WithSummaryStyle(SummaryStyle.Default.WithTimeUnit(TimeUnit.Millisecond)));
15+
BenchmarkRunner.Run<Benchmark>(DefaultConfig.Instance.WithSummaryStyle(SummaryStyle.Default.WithTimeUnit(TimeUnit.Millisecond)), args);
1616
}
1717
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"profiles": {
3+
"Default": {
4+
"commandName": "Project",
5+
"commandLineArgs": ""
6+
},
7+
"Measure": {
8+
"commandName": "Project",
9+
"commandLineArgs": "--launchCount 20"
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)