Skip to content

test: add benchmark coverage for ExecutorEventHandler performance#6344

Open
sachin9058 wants to merge 1 commit intomindersec:mainfrom
sachin9058:test/executor-benchmark
Open

test: add benchmark coverage for ExecutorEventHandler performance#6344
sachin9058 wants to merge 1 commit intomindersec:mainfrom
sachin9058:test/executor-benchmark

Conversation

@sachin9058
Copy link
Copy Markdown
Contributor

@sachin9058 sachin9058 commented Apr 11, 2026

Summary

This PR adds benchmark coverage for ExecutorEventHandler.HandleEntityEvent to evaluate its performance characteristics.

Currently, there is no benchmark for this critical execution path, making it difficult to understand throughput and memory allocation behavior or detect performance regressions over time. This change introduces both sequential and parallel benchmarks to provide a baseline for future performance analysis.

The benchmarks use a minimal stub executor to isolate handler logic and avoid external dependencies.

No additional dependencies are required for this change.

Fixes #6343

Testing

  • Ran benchmarks locally using:
    go test ./internal/engine -bench=.

Benchmark results:

BenchmarkHandleEntityEvent-12 1803787 635.4 ns/op 840 B/op 14 allocs/op
BenchmarkHandleEntityEventParallel-12 2365395 499.8 ns/op 838 B/op 14 allocs/op

  • Verified both sequential and parallel benchmarks execute successfully
  • Confirmed allocation reporting (allocs/op, B/op)
  • Ensured lint checks pass (make lint-fix)

The parallel benchmark shows improved throughput compared to sequential execution, indicating the handler scales well under concurrent workloads.

No functional changes were introduced, as this PR only adds benchmark tests.
No functional changes were introduced, as this PR only adds benchmark tests.

@sachin9058 sachin9058 requested a review from a team as a code owner April 11, 2026 13:23
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 59.327%. remained the same — sachin9058:test/executor-benchmark into mindersec:main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add benchmark coverage for ExecutorEventHandler to evaluate performance characteristics

2 participants