Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c0ffeeartc/PerformanceTestsRunner
Helper scripts to run performance tests and get memory, timing and some other info output in Console
https://github.com/c0ffeeartc/PerformanceTestsRunner
csharp performance tests
Last synced: 3 months ago
JSON representation
Helper scripts to run performance tests and get memory, timing and some other info output in Console
- Host: GitHub
- URL: https://github.com/c0ffeeartc/PerformanceTestsRunner
- Owner: c0ffeeartc
- License: mit
- Created: 2021-03-12T23:58:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-03-27T18:38:26.000Z (over 3 years ago)
- Last Synced: 2024-01-28T23:38:31.328Z (10 months ago)
- Topics: csharp, performance, tests
- Language: C#
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Performance Tests Runner
Helper scripts to run performance tests and get memory, timing and some other info output in Console## Usage
1. Copy `PerformanceTests` folder to your performance tests project
2. Create test class that implements `IPerformanceTest`, and optionally `IToTestString`
3. Write `Main` function similar to following:```csharp
using PerformanceTests;
using R = PerformanceTests.PerformanceTestRunner;class MainClass
{
public static void Main(string[] args)
{
MemoryHelper.MemoryBegin( );R.Log("Running performance tests...");
R.Log("\nMain tests");
R.Run();
R.Run();
R.Run( ()=> new TestWithArgs(5,100) );R.Log();
R.Log("Other");
R.Run();
R.Run();MemoryHelper.MemoryEnd( );
}
}
```4. Run tests and get output similar to:
```
Memory at process start: 4197968, 4447227904, 0, 4447227904, 2568192, 0, 0, 0
Memory before tests: 4215296, 4518735872, 0, 4518735872, 3801088, 0, 0, 0Running performance tests...
Main Tests
1e+005 Test1: 116 ms mem.DIFF 63253056 bytes mem.ALL 128652168, 4650078208, 0, 4650078208, 138571776, 0, 0, 0 bytes
1e+005 Test2: 25 ms mem.DIFF 2889248 bytes mem.ALL 134854160, 4656947200, 0, 4656947200, 145063936, 0, 0, 0 bytes
1e+005 TestWithArgs: 24 ms mem.DIFF 2889248 bytes mem.ALL 132528880, 4684337152, 0, 4684337152, 165433344, 0, 0, 0 bytesOther
1e+006 TestOther1: 38 ms mem.DIFF 0 bytes mem.ALL 57267904, 4583456768, 0, 4583456768, 66060288, 0, 0, 0 bytes
1e+006 TestOther2: 45 ms mem.DIFF 0 bytes mem.ALL 57267904, 4583456768, 0, 4583456768, 66060288, 0, 0, 0 bytesMemory after tests: 58820936, 4585562112, 0, 4585562112, 67633152, 0, 0, 0
```