Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Eliminate allocations in AuthorizationPolicy.CombineAsync with no policy - #1899

Merged
JamesNK merged 2 commits into
jamesnk/authz-middlewarefrom
jamesnk/authz-policyperf
Nov 6, 2018
Merged

JamesNK merged 2 commits into
jamesnk/authz-middlewarefrom
jamesnk/authz-policyperf

Conversation

@JamesNK

@JamesNK JamesNK commented Nov 3, 2018 •

Copy link
Copy Markdown
Member

Used by AuthorizationMiddleware. Want to avoid allocations when there is no policy to evaluate.

Hide whitespace for best reviewing experience.

On #1894

HaoK
HaoK previously approved these changes Nov 3, 2018
@davidfowl

Copy link
Copy Markdown
Member

Where's the before and after number

@JamesNK

JamesNK commented Nov 3, 2018

Copy link
Copy Markdown
Member Author

Note: I added caching to policy provider tasks.

Before:

       Method |     Mean |    Error |   StdDev |        Op/s |  Gen 0 | Allocated |
------------- |---------:|---------:|---------:|------------:|-------:|----------:|
 CombineAsync | 100.7 ns | 2.348 ns | 4.174 ns | 9,927,843.4 | 0.0203 |     184 B |

After:

       Method |     Mean |     Error |    StdDev |         Op/s | Allocated |
------------- |---------:|----------:|----------:|-------------:|----------:|
 CombineAsync | 57.57 ns | 0.5720 ns | 0.5351 ns | 17,371,422.1 |       0 B |

@JamesNK
JamesNK dismissed HaoK’s stale review November 3, 2018 20:12

More changes

@JamesNK
JamesNK merged commit 87c1f1f into jamesnk/authz-middleware Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants