Roslyn-Stone Benchmarks
This project contains performance benchmarks for Roslyn-Stone using BenchmarkDotNet.
Running Benchmarks
Run All Benchmarks
dotnet run --project tests/RoslynStone.Benchmarks --configuration Release
Run Specific Benchmark
dotnet run --project tests/RoslynStone.Benchmarks --configuration Release -- --filter *RoslynScriptingServiceBenchmarks*
Using Cake Build Script
dotnet cake --target=Benchmark
Available Benchmarks
RoslynScriptingServiceBenchmarks
ExecuteSimpleExpression- Basic arithmetic operationsExecuteVariableAssignment- Variable declaration and usageExecuteLinqQuery- LINQ query executionExecuteComplexExpression- Complex data structure manipulationExecuteWithStringManipulation- String operations
CompilationServiceBenchmarks
ValidateSimpleExpression- Code validation of simple expressionsValidateComplexCode- Code validation of complex code blocksValidateWithError- Validation with compilation errorsCompileToAssembly- Full assembly compilation
NuGetServiceBenchmarks
SearchPackages- Package search operationsGetPackageVersions- Retrieve package version informationGetPackageReadme- Fetch package README files
Benchmark Results
Benchmark results are saved to ./artifacts/benchmarks/ and include:
- Execution times (Min, Max, Mean, Median)
- Memory allocations
- Statistical analysis
Tips
- Always run benchmarks in Release configuration
- Close other applications to minimize interference
- Run multiple iterations for consistent results
- Compare results across different machines cautiously