-
Notifications
You must be signed in to change notification settings - Fork 0
Бенчмарк #18
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
Open
Danika1808
wants to merge
1
commit into
master
Choose a base branch
from
Benchmark
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Бенчмарк #18
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.30621.155 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "Benchmark\Benchmark.csproj", "{43585CD2-9507-48FC-8A39-325D53A6B2C3}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{65A66F13-289C-44A0-BD3D-B00E57753E9F}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {43585CD2-9507-48FC-8A39-325D53A6B2C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {43585CD2-9507-48FC-8A39-325D53A6B2C3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {43585CD2-9507-48FC-8A39-325D53A6B2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {43585CD2-9507-48FC-8A39-325D53A6B2C3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {65A66F13-289C-44A0-BD3D-B00E57753E9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {65A66F13-289C-44A0-BD3D-B00E57753E9F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {65A66F13-289C-44A0-BD3D-B00E57753E9F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {65A66F13-289C-44A0-BD3D-B00E57753E9F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {50156758-2800-4502-AE2B-0A243EDDFBEE} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="BenchmarkDotNet" Version="0.12.1" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| using BenchmarkDotNet.Running; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace Benchmark | ||
| { | ||
| class EasiestTest | ||
| { | ||
| public static void OnTestsStart() => | ||
| BenchmarkRunner.Run<TestClass>(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using System; | ||
|
|
||
| namespace Benchmark | ||
| { | ||
| class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| EasiestTest.OnTestsStart(); | ||
|
|
||
| Console.ReadKey(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| using System; | ||
| using BenchmarkDotNet; | ||
| using System.Text; | ||
| using BenchmarkDotNet.Attributes; | ||
|
|
||
| namespace Benchmark | ||
| { | ||
| class TestClass | ||
| { | ||
| void SimulateWork() | ||
| { | ||
| StringBuilder builder = new StringBuilder(); | ||
| for (int i = 0; i < 10000; i++) | ||
| builder.Append(i.ToString()); | ||
| } | ||
|
|
||
| public static void PbStaticVoid() | ||
| { | ||
| StringBuilder builder = new StringBuilder(); | ||
| for (int i = 0; i < 10000; i++) | ||
| builder.Append(i.ToString()); | ||
| } | ||
|
|
||
| [Benchmark(Description = "PbVoid")] | ||
| public void PbVoid() => | ||
| SimulateWork(); | ||
|
|
||
| [Benchmark(Description = "PbVirtualVoid")] | ||
| public virtual void PbVirtualVoid() => | ||
| SimulateWork(); | ||
|
|
||
| public static void PbGenericStaticVoid<T>() | ||
| { | ||
| StringBuilder builder = new StringBuilder(); | ||
| for (int i = 0; i < 10000; i++) | ||
| builder.Append(i.ToString()); | ||
| } | ||
|
|
||
| public static void PbGenericStaticVoid() => | ||
| PbGenericStaticVoid<int>(); | ||
|
|
||
|
|
||
| [Benchmark(Description = "PbGenericVoid")] | ||
| public void PbGenericVoid() => | ||
| SimulateWork(); | ||
|
|
||
| [Benchmark(Description = "PbDynamic")] | ||
| public dynamic PbDynamic() | ||
| { | ||
| StringBuilder builder = new StringBuilder(); | ||
| for (int i = 0; i < 10000; i++) | ||
| builder.Append(i.ToString()); | ||
| return builder; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="NUnit" Version="3.12.0" /> | ||
| <PackageReference Include="NUnit3TestAdapter" Version="3.16.1" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0"/> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Tests | ||
| { | ||
| public class Tests | ||
| { | ||
| [SetUp] | ||
| public void Setup() | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| public void Test1() | ||
| { | ||
| Assert.Pass(); | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем?