Skip to content

Commit d561531

Browse files
authored
feat: add multi-threaded evaluation benchmark suite with comprehensive C# implementation (microsoft#457)
This commit introduces a complete multi-threaded evaluation benchmark suite for both Rust and C# implementations of Regorus. - Implemented engine evaluation benchmark with input and engine cloning strategies - Implemented compiled policy evaluation benchmark with input cloning and shared compiled policy strategies. - Created EngineEvaluationBenchmark.cs and CompiledPolicyEvaluationBenchmark.cs with time-based execution (3s warmup + 3s evaluation) - Implemented configuration options matching Rust implementation (useClonedEngines, useSharedPolicies parameters) - Created markdown analysis documentation with cross-platform performance analysis - C# seems to achieve 58-89% of Rust performance on test machine. Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
1 parent a53c7c8 commit d561531

56 files changed

Lines changed: 2763 additions & 197 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 70 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ test-generator = "0.3.1"
125125
walkdir = "2.3.2"
126126
criterion = { version = "0.7" }
127127

128+
num_cpus = "1.16"
129+
128130
[build-dependencies]
129131
anyhow = "1.0"
130132

@@ -158,6 +160,16 @@ name = "schema_validation_benchmark"
158160
harness = false
159161
required-features = ["azure_policy"]
160162

163+
[[bench]]
164+
name = "engine_evaluation_benchmark"
165+
path = "benches/evaluation/engine_evaluation_benchmark.rs"
166+
harness = false
167+
168+
[[bench]]
169+
name = "compiled_policy_evaluation_benchmark"
170+
path = "benches/evaluation/compiled_policy_evaluation_benchmark.rs"
171+
harness = false
172+
161173
[[example]]
162174
name="regorus"
163175
harness=false

0 commit comments

Comments
 (0)