godaddy / asherah

Asherah is a multi-language, cross-platform application encryption SDK
MIT License
75 stars 47 forks source link

[go] new key cache backend: "simple" #1048

Closed aka-bo closed 2 months ago

aka-bo commented 2 months ago

To help us get this pull request reviewed and merged quickly, please be sure to include the following items:

PR Type

What kind of change does this PR introduce?

Backward Compatibility

Is this change backward compatible with the most recently released version? Does it introduce changes which might change the user experience in any way? Does it alter the API in any way?

What's new?

benchstat v0.5.0-main.txt v0.6.0-pr1048.txt
goos: darwin
goarch: arm64
pkg: github.com/godaddy/asherah/go/appencryption
                                                               │ v0.5.0-main.txt │          v0.6.0-pr1048.txt          │
                                                               │     sec/op      │   sec/op     vs base                │
KeyCache_GetOrLoad_MultipleThreadsReadExistingKey-12                 2.096µ ± 1%   1.104µ ± 4%  -47.35% (p=0.000 n=10)
KeyCache_GetOrLoad_MultipleThreadsWriteSameKey-12                    3.912µ ± 1%   1.346µ ± 1%  -65.61% (p=0.000 n=10)
KeyCache_GetOrLoad_MultipleThreadsWriteUniqueKeys-12                31.696µ ± 1%   9.825µ ± 2%  -69.00% (p=0.000 n=10)
KeyCache_GetOrLoad_MultipleThreadsReadRevokedKey-12                  5.048µ ± 1%   1.497µ ± 2%  -70.34% (p=0.000 n=10)
KeyCache_GetOrLoad_MultipleThreadsRead_NeedReloadKey-12             1715.0n ± 2%   674.0n ± 1%  -60.70% (p=0.000 n=10)
KeyCache_GetOrLoad_MultipleThreadsReadUniqueKeys-12                  2.537µ ± 1%   1.812µ ± 1%  -28.56% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsReadExistingKey-12           9.263µ ± 0%   3.070µ ± 0%  -66.86% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsWriteSameKey-12             13.569µ ± 0%   2.602µ ± 1%  -80.82% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsWriteUniqueKey-12           21.359µ ± 1%   5.022µ ± 2%  -76.49% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsReadStaleRevokedKey-12       377.9µ ± 3%   403.0µ ± 1%   +6.64% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsReadRevokedKey-12            8.098µ ± 0%   2.009µ ± 0%  -75.20% (p=0.000 n=10)
KeyCache_GetOrLoadLatest_MultipleThreadsReadUniqueKeys-12           12.354µ ± 1%   3.284µ ± 0%  -73.42% (p=0.000 n=10)
geomean                                                              9.555µ        3.450µ       -63.89%