Skip to content

chore(benchmark): implement consolidated architecture aligned with go-casbin#486

Closed
AKonnyaku wants to merge 23 commits intocasbin:masterfrom
AKonnyaku:benchmark-refractor
Closed

chore(benchmark): implement consolidated architecture aligned with go-casbin#486
AKonnyaku wants to merge 23 commits intocasbin:masterfrom
AKonnyaku:benchmark-refractor

Conversation

@AKonnyaku
Copy link
Contributor

Summary

This PR refactors the benchmark module to align with the go-casbin implementation. The new design uses 4 core files to cover all test scenarios and improves measurement reliability.

Technical Implementation

1. Core Architecture

The benchmark suite is now composed of the following 4 files:

  • BenchmarkRunner.java: Central entry point with multi-mode support.
  • BenchmarkEnforce.java: Auth throughput testing for all models using JMH parameters.
  • BenchmarkManagement.java: Management API performance testing.
  • BenchmarkMemory.java: Heap memory analysis.

2. Alignment with go-casbin

  • Scenario Coverage: Supports ACL, RBAC (Small, Medium, Large scales), and ABAC scenarios.
  • Data Generation: Dynamically generates 100,000 rules in memory for large-scale tests, following the logic used in the Go implementation.

3. Measurement Accuracy

  • Anti-JIT: Uses cyclic request lists to prevent JIT constant folding and simulate realistic branch prediction.
  • I/O Control: Disables internal enforcer logging during active measurement rounds to ensure throughput metrics are not affected by console I/O.

4. Execution Modes

The runner supports three modes via the BENCHMARK_MODE environment variable:

  • SMOKE: 2-minute targeted run for PR validation.
  • AGILE: 15-minute full coverage run with 1s iterations for automated monitoring.
  • STRICT: 3-hour high-precision run for release auditing.

Visualization

Performance data is compatible with automated tracking and visualization tools.
Performance dashboard: (To be updated after merge)

Related Issues

Ref #472
Ref #479

@CLAassistant
Copy link

CLAassistant commented Dec 29, 2025

CLA assistant check
All committers have signed the CLA.

@AKonnyaku AKonnyaku changed the title refactor(benchmark): implement 4-file architecture aligned with go-casbin chore(benchmark): implement consolidated architecture aligned with go-casbin Dec 29, 2025
@hsluoyz
Copy link
Member

hsluoyz commented Dec 31, 2025

replaced by: #480

@hsluoyz hsluoyz closed this Dec 31, 2025
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.

3 participants