-
Notifications
You must be signed in to change notification settings - Fork 1
添加benchmark #1
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
base: main
Are you sure you want to change the base?
添加benchmark #1
Conversation
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.
Pull Request Overview
This PR adds a benchmarking project to compare SimpleBinarySerialization performance against other serialization libraries including System.Text.Json, Newtonsoft.Json, and MemoryPack. However, the project contains several spelling errors that need to be corrected.
- Adds a new benchmark project to the solution
- Implements benchmarks comparing serialization performance across multiple libraries
- Updates Visual Studio version metadata to Version 18
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| SimpleBinarySerialization.sln | Updates VS version and adds the benchmark project to the solution |
| SimpleBinarySerialization.Benchmakrs/SimpleBinarySerialization.Benchmakrs.csproj | Defines the benchmark project with dependencies on BenchmarkDotNet, MemoryPack, and Newtonsoft.Json |
| SimpleBinarySerialization.Benchmakrs/SerilizationBenchmark.cs | Implements benchmark tests for different serialization methods |
| SimpleBinarySerialization.Benchmakrs/Program.cs | Entry point that runs the benchmarks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBinarySerialization", "SimpleBinarySerialization\SimpleBinarySerialization.csproj", "{ECAA2430-866C-467B-8B77-D9DAA629D8CC}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBinarySerialization.Benchmakrs", "SimpleBinarySerialization.Benchmakrs\SimpleBinarySerialization.Benchmakrs.csproj", "{E127D779-53D4-44F7-AB74-B2BF10CB3DEF}" |
Copilot
AI
Oct 30, 2025
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.
The project name 'Benchmakrs' is misspelled. It should be 'Benchmarks'.
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBinarySerialization.Benchmakrs", "SimpleBinarySerialization.Benchmakrs\SimpleBinarySerialization.Benchmakrs.csproj", "{E127D779-53D4-44F7-AB74-B2BF10CB3DEF}" | |
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBinarySerialization.Benchmarks", "SimpleBinarySerialization.Benchmarks\SimpleBinarySerialization.Benchmarks.csproj", "{E127D779-53D4-44F7-AB74-B2BF10CB3DEF}" |
| namespace SimpleBinarySerialization.Benchmakrs; | ||
|
|
||
| [MemoryDiagnoser] | ||
| public class SerilizationBenchmark |
Copilot
AI
Oct 30, 2025
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.
The class name 'SerilizationBenchmark' is misspelled. It should be 'SerializationBenchmark'.
| public class SerilizationBenchmark | |
| public class SerializationBenchmark |
| using MemoryPack; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace SimpleBinarySerialization.Benchmakrs; |
Copilot
AI
Oct 30, 2025
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.
The namespace 'Benchmakrs' is misspelled. It should be 'Benchmarks'.
| namespace SimpleBinarySerialization.Benchmakrs; | |
| namespace SimpleBinarySerialization.Benchmarks; |
| @@ -0,0 +1,12 @@ | |||
| using BenchmarkDotNet.Running; | |||
|
|
|||
| namespace SimpleBinarySerialization.Benchmakrs | |||
Copilot
AI
Oct 30, 2025
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.
The namespace 'Benchmakrs' is misspelled. It should be 'Benchmarks'.
| namespace SimpleBinarySerialization.Benchmakrs | |
| namespace SimpleBinarySerialization.Benchmarks |
| public class SerilizationBenchmark | ||
| { | ||
| private User obj = null!; | ||
| public int Length { get; set; } |
Copilot
AI
Oct 30, 2025
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.
The 'Length' property is declared but never used in the benchmark class. Consider removing it if it's not needed.
| public int Length { get; set; } |
| { | ||
| static void Main(string[] args) | ||
| { | ||
| var _ = BenchmarkRunner.Run(typeof(Program).Assembly); |
Copilot
AI
Oct 30, 2025
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.
This assignment to _ is useless, since its value is never read.
| var _ = BenchmarkRunner.Run(typeof(Program).Assembly); | |
| BenchmarkRunner.Run(typeof(Program).Assembly); |
| private User obj = null!; | ||
| public int Length { get; set; } | ||
|
|
||
| private SimpleBinarySerializer serializer = new(); |
Copilot
AI
Oct 30, 2025
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.
Field 'serializer' can be 'readonly'.
| private SimpleBinarySerializer serializer = new(); | |
| private readonly SimpleBinarySerializer serializer = new(); |
No description provided.