Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Preprocess the access to the request object in the policy (#1279)
- Loading branch information
18f37ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
BenchmarkCachedRaw - ns/op
20.68
ns/op20.92
ns/op0.99
BenchmarkCachedRaw - B/op
0
B/op0
B/opNaN
BenchmarkCachedRaw - allocs/op
0
allocs/op0
allocs/opNaN
BenchmarkCachedBasicModel - ns/op
232.3
ns/op210.9
ns/op1.10
BenchmarkCachedBasicModel - B/op
104
B/op104
B/op1
BenchmarkCachedBasicModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModel - ns/op
233.5
ns/op210
ns/op1.11
BenchmarkCachedRBACModel - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelSmall - ns/op
234.6
ns/op226.6
ns/op1.04
BenchmarkCachedRBACModelSmall - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelSmall - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelMedium - ns/op
257.2
ns/op227
ns/op1.13
BenchmarkCachedRBACModelMedium - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelMedium - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelLarge - ns/op
230.1
ns/op214.1
ns/op1.07
BenchmarkCachedRBACModelLarge - B/op
96
B/op96
B/op1
BenchmarkCachedRBACModelLarge - allocs/op
3
allocs/op3
allocs/op1
BenchmarkCachedRBACModelWithResourceRoles - ns/op
243
ns/op211.7
ns/op1.15
BenchmarkCachedRBACModelWithResourceRoles - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithResourceRoles - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDomains - ns/op
252.1
ns/op237.1
ns/op1.06
BenchmarkCachedRBACModelWithDomains - B/op
120
B/op120
B/op1
BenchmarkCachedRBACModelWithDomains - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedABACModel - ns/op
3915
ns/op3889
ns/op1.01
BenchmarkCachedABACModel - B/op
1524
B/op1521
B/op1.00
BenchmarkCachedABACModel - allocs/op
18
allocs/op18
allocs/op1
BenchmarkCachedKeyMatchModel - ns/op
257.6
ns/op247.6
ns/op1.04
BenchmarkCachedKeyMatchModel - B/op
152
B/op152
B/op1
BenchmarkCachedKeyMatchModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDeny - ns/op
248.2
ns/op224.7
ns/op1.10
BenchmarkCachedRBACModelWithDeny - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithDeny - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedPriorityModel - ns/op
246.6
ns/op217.3
ns/op1.13
BenchmarkCachedPriorityModel - B/op
104
B/op104
B/op1
BenchmarkCachedPriorityModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedWithEnforceContext - ns/op
458.7
ns/op404.1
ns/op1.14
BenchmarkCachedWithEnforceContext - B/op
240
B/op240
B/op1
BenchmarkCachedWithEnforceContext - allocs/op
5
allocs/op5
allocs/op1
BenchmarkCachedRBACModelMediumParallel - ns/op
222.2
ns/op210.2
ns/op1.06
BenchmarkCachedRBACModelMediumParallel - B/op
105
B/op105
B/op1
BenchmarkCachedRBACModelMediumParallel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkHasPolicySmall - ns/op
712.6
ns/op644
ns/op1.11
BenchmarkHasPolicySmall - B/op
150
B/op150
B/op1
BenchmarkHasPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyMedium - ns/op
728.6
ns/op683.6
ns/op1.07
BenchmarkHasPolicyMedium - B/op
157
B/op157
B/op1
BenchmarkHasPolicyMedium - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyLarge - ns/op
824
ns/op720.8
ns/op1.14
BenchmarkHasPolicyLarge - B/op
165
B/op165
B/op1
BenchmarkHasPolicyLarge - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicySmall - ns/op
736.8
ns/op665.7
ns/op1.11
BenchmarkAddPolicySmall - B/op
152
B/op152
B/op1
BenchmarkAddPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkAddPolicyMedium - ns/op
1092
ns/op829.1
ns/op1.32
BenchmarkAddPolicyMedium - B/op
183
B/op178
B/op1.03
BenchmarkAddPolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicyLarge - ns/op
1640
ns/op1524
ns/op1.08
BenchmarkAddPolicyLarge - B/op
428
B/op457
B/op0.94
BenchmarkAddPolicyLarge - allocs/op
9
allocs/op9
allocs/op1
BenchmarkRemovePolicySmall - ns/op
774.2
ns/op690.6
ns/op1.12
BenchmarkRemovePolicySmall - B/op
166
B/op166
B/op1
BenchmarkRemovePolicySmall - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyMedium - ns/op
855.3
ns/op763.3
ns/op1.12
BenchmarkRemovePolicyMedium - B/op
178
B/op178
B/op1
BenchmarkRemovePolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyLarge - ns/op
1693
ns/op1665
ns/op1.02
BenchmarkRemovePolicyLarge - B/op
286
B/op287
B/op1.00
BenchmarkRemovePolicyLarge - allocs/op
13
allocs/op13
allocs/op1
BenchmarkRaw - ns/op
20.79
ns/op20.9
ns/op0.99
BenchmarkRaw - B/op
0
B/op0
B/opNaN
BenchmarkRaw - allocs/op
0
allocs/op0
allocs/opNaN
BenchmarkBasicModel - ns/op
4859
ns/op4752
ns/op1.02
BenchmarkBasicModel - B/op
1491
B/op1489
B/op1.00
BenchmarkBasicModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkRBACModel - ns/op
7529
ns/op7239
ns/op1.04
BenchmarkRBACModel - B/op
2039
B/op2035
B/op1.00
BenchmarkRBACModel - allocs/op
35
allocs/op35
allocs/op1
BenchmarkRBACModelSizes/small - ns/op
68295
ns/op64127
ns/op1.06
BenchmarkRBACModelSizes/small - B/op
19953
B/op19955
B/op1.00
BenchmarkRBACModelSizes/small - allocs/op
480
allocs/op480
allocs/op1
BenchmarkRBACModelSizes/medium - ns/op
840913
ns/op646649
ns/op1.30
BenchmarkRBACModelSizes/medium - B/op
191372
B/op191249
B/op1.00
BenchmarkRBACModelSizes/medium - allocs/op
4827
allocs/op4827
allocs/op1
BenchmarkRBACModelSizes/large - ns/op
9831044
ns/op7535517
ns/op1.30
BenchmarkRBACModelSizes/large - B/op
1903188
B/op1901446
B/op1.00
BenchmarkRBACModelSizes/large - allocs/op
48274
allocs/op48229
allocs/op1.00
BenchmarkRBACModelSmall - ns/op
80128
ns/op76514
ns/op1.05
BenchmarkRBACModelSmall - B/op
20095
B/op20049
B/op1.00
BenchmarkRBACModelSmall - allocs/op
615
allocs/op615
allocs/op1
BenchmarkRBACModelMedium - ns/op
767833
ns/op737731
ns/op1.04
BenchmarkRBACModelMedium - B/op
194234
B/op194399
B/op1.00
BenchmarkRBACModelMedium - allocs/op
6023
allocs/op6022
allocs/op1.00
BenchmarkRBACModelLarge - ns/op
9482976
ns/op8543339
ns/op1.11
BenchmarkRBACModelLarge - B/op
1948182
B/op1947080
B/op1.00
BenchmarkRBACModelLarge - allocs/op
60927
allocs/op60884
allocs/op1.00
BenchmarkRBACModelWithResourceRoles - ns/op
6191
ns/op5986
ns/op1.03
BenchmarkRBACModelWithResourceRoles - B/op
1823
B/op1820
B/op1.00
BenchmarkRBACModelWithResourceRoles - allocs/op
27
allocs/op27
allocs/op1
BenchmarkRBACModelWithDomains - ns/op
6761
ns/op6623
ns/op1.02
BenchmarkRBACModelWithDomains - B/op
1807
B/op1803
B/op1.00
BenchmarkRBACModelWithDomains - allocs/op
25
allocs/op25
allocs/op1
BenchmarkABACModel - ns/op
3705
ns/op3727
ns/op0.99
BenchmarkABACModel - B/op
1515
B/op1511
B/op1.00
BenchmarkABACModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkABACRuleModel - ns/op
4951313
ns/op5138942
ns/op0.96
BenchmarkABACRuleModel - B/op
1305613
B/op1303790
B/op1.00
BenchmarkABACRuleModel - allocs/op
40088
allocs/op40088
allocs/op1
BenchmarkKeyMatchModel - ns/op
7943
ns/op7955
ns/op1.00
BenchmarkKeyMatchModel - B/op
3027
B/op3021
B/op1.00
BenchmarkKeyMatchModel - allocs/op
37
allocs/op37
allocs/op1
BenchmarkRBACModelWithDeny - ns/op
9577
ns/op9217
ns/op1.04
BenchmarkRBACModelWithDeny - B/op
2448
B/op2444
B/op1.00
BenchmarkRBACModelWithDeny - allocs/op
49
allocs/op49
allocs/op1
BenchmarkPriorityModel - ns/op
5497
ns/op5486
ns/op1.00
BenchmarkPriorityModel - B/op
1740
B/op1739
B/op1.00
BenchmarkPriorityModel - allocs/op
22
allocs/op22
allocs/op1
BenchmarkRBACModelWithDomainPatternLarge - ns/op
32144
ns/op29776
ns/op1.08
BenchmarkRBACModelWithDomainPatternLarge - B/op
16618
B/op16608
B/op1.00
BenchmarkRBACModelWithDomainPatternLarge - allocs/op
164
allocs/op164
allocs/op1
BenchmarkRoleManagerSmall - ns/op
107531
ns/op104542
ns/op1.03
BenchmarkRoleManagerSmall - B/op
11953
B/op11953
B/op1
BenchmarkRoleManagerSmall - allocs/op
797
allocs/op797
allocs/op1
BenchmarkRoleManagerMedium - ns/op
1131397
ns/op1077990
ns/op1.05
BenchmarkRoleManagerMedium - B/op
125909
B/op125909
B/op1
BenchmarkRoleManagerMedium - allocs/op
8741
allocs/op8741
allocs/op1
BenchmarkRoleManagerLarge - ns/op
16046113
ns/op13296752
ns/op1.21
BenchmarkRoleManagerLarge - B/op
1349923
B/op1349919
B/op1.00
BenchmarkRoleManagerLarge - allocs/op
89741
allocs/op89741
allocs/op1
BenchmarkBuildRoleLinksWithPatternLarge - ns/op
8676248404
ns/op7546230623
ns/op1.15
BenchmarkBuildRoleLinksWithPatternLarge - B/op
5286035008
B/op5285620520
B/op1.00
BenchmarkBuildRoleLinksWithPatternLarge - allocs/op
60931010
allocs/op60930738
allocs/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op
234686311
ns/op207452963
ns/op1.13
BenchmarkBuildRoleLinksWithDomainPatternLarge - B/op
139575657
B/op139539172
B/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - allocs/op
1670246
allocs/op1670243
allocs/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op
8997878438
ns/op7728443257
ns/op1.16
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - B/op
5423956184
B/op5422743952
B/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - allocs/op
62541557
allocs/op62541253
allocs/op1.00
BenchmarkHasLinkWithPatternLarge - ns/op
14166
ns/op13222
ns/op1.07
BenchmarkHasLinkWithPatternLarge - B/op
7551
B/op7537
B/op1.00
BenchmarkHasLinkWithPatternLarge - allocs/op
111
allocs/op111
allocs/op1
BenchmarkHasLinkWithDomainPatternLarge - ns/op
737.4
ns/op720.3
ns/op1.02
BenchmarkHasLinkWithDomainPatternLarge - B/op
80
B/op80
B/op1
BenchmarkHasLinkWithDomainPatternLarge - allocs/op
5
allocs/op5
allocs/op1
BenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op
15063
ns/op12809
ns/op1.18
BenchmarkHasLinkWithPatternAndDomainPatternLarge - B/op
7550
B/op7538
B/op1.00
BenchmarkHasLinkWithPatternAndDomainPatternLarge - allocs/op
111
allocs/op111
allocs/op1
This comment was automatically generated by workflow using github-action-benchmark.
18f37ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.10
.BenchmarkCachedBasicModel - ns/op
232.3
ns/op210.9
ns/op1.10
BenchmarkCachedRBACModel - ns/op
233.5
ns/op210
ns/op1.11
BenchmarkCachedRBACModelMedium - ns/op
257.2
ns/op227
ns/op1.13
BenchmarkCachedRBACModelWithResourceRoles - ns/op
243
ns/op211.7
ns/op1.15
BenchmarkCachedRBACModelWithDeny - ns/op
248.2
ns/op224.7
ns/op1.10
BenchmarkCachedPriorityModel - ns/op
246.6
ns/op217.3
ns/op1.13
BenchmarkCachedWithEnforceContext - ns/op
458.7
ns/op404.1
ns/op1.14
BenchmarkHasPolicySmall - ns/op
712.6
ns/op644
ns/op1.11
BenchmarkHasPolicyLarge - ns/op
824
ns/op720.8
ns/op1.14
BenchmarkAddPolicySmall - ns/op
736.8
ns/op665.7
ns/op1.11
BenchmarkAddPolicyMedium - ns/op
1092
ns/op829.1
ns/op1.32
BenchmarkRemovePolicySmall - ns/op
774.2
ns/op690.6
ns/op1.12
BenchmarkRemovePolicyMedium - ns/op
855.3
ns/op763.3
ns/op1.12
BenchmarkRBACModelSizes/medium - ns/op
840913
ns/op646649
ns/op1.30
BenchmarkRBACModelSizes/large - ns/op
9831044
ns/op7535517
ns/op1.30
BenchmarkRBACModelLarge - ns/op
9482976
ns/op8543339
ns/op1.11
BenchmarkRoleManagerLarge - ns/op
16046113
ns/op13296752
ns/op1.21
BenchmarkBuildRoleLinksWithPatternLarge - ns/op
8676248404
ns/op7546230623
ns/op1.15
BenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op
234686311
ns/op207452963
ns/op1.13
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op
8997878438
ns/op7728443257
ns/op1.16
BenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op
15063
ns/op12809
ns/op1.18
This comment was automatically generated by workflow using github-action-benchmark.