Skip to content

Commit

Permalink
Fix benchmarks and update results (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
pokonski authored May 8, 2024
1 parent 81a4345 commit b9de188
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Benchmark results

Benchmarks ran on Ubuntu 17.04 64bit, i7 6700k @ 4.0Ghz, 32 GB RAM with Ruby 2.3.
Benchmarks ran on MacBook Pro M1 Pro 2021, 32 GB RAM on Ruby 3.2.

## permissions.rb

This benchmark runs `can?` method for the 3 user roles for 20 seconds each, for both CanCan and AccessGranted.

```
Warming up --------------------------------------
ag-admin 158.815k i/100ms
ag-moderator 161.055k i/100ms
ag-user 161.670k i/100ms
cancan-admin 14.865k i/100ms
cancan-moderator 13.181k i/100ms
cancan-user 18.907k i/100ms
ag-admin 358.693k i/100ms
ag-moderator 359.044k i/100ms
ag-user 360.627k i/100ms
cancan-admin 30.797k i/100ms
cancan-moderator 26.825k i/100ms
cancan-user 37.946k i/100ms
Calculating -------------------------------------
ag-admin 2.141M3.9%) i/s - 10.799M in 5.052573s
ag-moderator 2.180M2.1%) i/s - 10.952M in 5.025727s
ag-user 2.206M (± 0.4%) i/s - 11.155M in 5.056550s
cancan-admin 158.288k2.4%) i/s - 802.710k in 5.074299s
cancan-moderator 142.573k2.1%) i/s - 724.955k in 5.087277s
cancan-user 204.783k2.2%) i/s - 1.040M in 5.080488s
ag-admin 3.640M0.3%) i/s - 18.293M in 5.025691s
ag-moderator 3.642M0.4%) i/s - 18.311M in 5.027575s
ag-user 3.643M (± 0.3%) i/s - 18.392M in 5.049271s
cancan-admin 308.383k0.7%) i/s - 1.571M in 5.093398s
cancan-moderator 270.716k0.8%) i/s - 1.368M in 5.053863s
cancan-user 383.198k0.7%) i/s - 1.935M in 5.050472s
```
4 changes: 2 additions & 2 deletions benchmarks/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(user)
can :read, String
can :zoom, Integer
can :boom, Hash
can :rub, Fixnum
can :rub, File
end
end

Expand All @@ -37,7 +37,7 @@ def configure
can :read, String
can :zoom, Integer
can :boom, Hash
can :rub, Fixnum
can :rub, File
end
end
end
Expand Down

0 comments on commit b9de188

Please sign in to comment.