Skip to content

chore(benchmark): switch JMH output time unit to nanoseconds#476

Closed
DeProfunds wants to merge 10 commits intoapache:masterfrom
DeProfunds:benchmark/pr6
Closed

chore(benchmark): switch JMH output time unit to nanoseconds#476
DeProfunds wants to merge 10 commits intoapache:masterfrom
DeProfunds:benchmark/pr6

Conversation

@DeProfunds
Copy link

Background

JMH benchmarks in jCasbin were reporting time/op in milliseconds via @OutputTimeUnit(TimeUnit.MILLISECONDS), while Casbin (Go) benchmarks commonly use ns/op. Even when the underlying work is comparable, differing output units can lead to misinterpretation when comparing absolute performance numbers across languages.

Changes

Switched JMH benchmark output time unit from milliseconds to nanoseconds (@OutputTimeUnit(TimeUnit.NANOSECONDS)) for benchmarks under src/test/java/org/casbin/jcasbin/main/benchmark, including:

  • BenchmarkBasicModel
  • BenchmarkABACModel
  • BenchmarkRestfulModel
  • BenchmarkDenyOverrideModel
  • BenchmarkPriorityModel
  • BenchmarkRBACModelSingle
  • BenchmarkRBACModelSmall
  • BenchmarkRBACModelMedium
  • BenchmarkRBACModelLarge
  • BenchmarkRBACModelWithDomains
  • BenchmarkRBACModelWithResourceRoles

Verification

  • mvn test (passed)

@CLAassistant
Copy link

CLAassistant commented Dec 25, 2025

CLA assistant check
All committers have signed the CLA.

@DeProfunds DeProfunds changed the title bench: unify JMH output time unit to ns for cross-language comparability chore(benchmark): switch JMH output time unit to nanoseconds Dec 25, 2025
@DeProfunds DeProfunds closed this Dec 25, 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