Skip to main content
Version: 4.x (latest)

RBAC performance benchmarks

Measured on November 14, 2026, using Node.js 22.14.0 on Windows 11 Pro / Intel Core i7-9700KF. All values are operations per second (ops/s); higher is better. Tests use the built v4 workspace, with logging disabled.

Library comparison​

The suite compares @rbac/core, accesscontrol@2.2.1, rbac@5.0.3, easy-rbac@4.0.0 and fast-rbac@2.0.1. The small dataset uses a few roles and permissions; the large dataset has 200 resources, inheritance, exact permissions and glob grants.

Direct permission checks​

Full comparison (ops/s)​

LibrarySmall directSmall inheritedSmall globLarge directLarge inheritedLarge glob
@rbac/core7,282,4997,330,0123,982,9177,086,1067,009,9573,527,345
AccessControl943,635668,308—908,823530,274—
rbac209,160201,247—111,53853,201—
Easy RBAC6,119,410364,9663,091,1135,747,2345,504,564122,253
Fast RBAC2,989,7022,871,6062,840,4812,567,8622,629,4212,600,415

An em dash means that suite exercises the library through an admin permission scenario instead of an equivalent glob API. All measurements include the cost of the library-specific can() invocation and any await in the timed callback. Different APIs and permission models make these indicative throughput comparisons, not proof of identical authorization semantics or a universal ranking.

Conditional authorization​

The large dataset also measures conditional grants in @rbac/core:

Condition typeOps/s
Node-style callback (scheduled with setImmediate)388,996
Async predicate2,152,776
Resolved Promise2,316,798

Callbacks schedule additional work, so those figures are not equivalent to the cost of a synchronous predicate.

Isolated engine measurements​

npm run bench:engine repeats 300,000 checks per sample, with 50,000 warmup checks and five samples per scenario. The figures below are the median ops/s from that separate run:

ScenarioOps/sScenarioOps/s
Exact grant11,821,309Inherited grant12,864,770
Simple glob grant5,220,169Regex grant2,685,078
Conditional sync2,357,719Conditional async2,596,618
Conditional denial2,489,162Unmatched operation5,162,996
Unknown role14,075,652Regex query1,168,111

The engine suite uses a different measurement harness from the third-party comparisons. Do not compare its absolute throughput directly with the figures above.

Microbenchmark​

The npm run bench:micro command measured a single exact grant using a stable string or an interpolated operation string, alongside bare Set.has() as a language-runtime reference:

OperationStable string (ops/s)Interpolated string (ops/s)
RBAC exact permission14,055,8293,662,664
Native Set.has()16,382,8233,739,846

This is a separate microbenchmark run; the native Set check does not implement the library's full authorization semantics.

Reproduce and inspect results​

From the repository root:

bash
npm ci
npm run build
npm run bench:engine
npm run bench

npm run bench writes complete samples, statistics and interactive charts to benchmarks/results/. The committed files from this run are:

The benchmark values depend on CPU, system load, JIT warmup and Node.js version. Rerun multiple times under comparable conditions, check authorization results for each competing API, and profile your own policy graph before drawing performance conclusions. See the benchmark methodology for suite details and output redirection.