Skip to content

perf: cache derived AWS V4 and OSS V4 keys#766

Open
akx wants to merge 1 commit into
apache:mainfrom
akx:cache-awslike-key-bits
Open

perf: cache derived AWS V4 and OSS V4 keys#766
akx wants to merge 1 commit into
apache:mainfrom
akx:cache-awslike-key-bits

Conversation

@akx

@akx akx commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR proposes to cache part of the HMAC computations for Amazon AWS V4 and the similarly-built Aliyun OSS V4 keys.

On my machine, this seems to benchmark a 20% improvement in speed in the common case of using the same RequestSigner with the same Credentials for sequential signings.

Note

The secret naturally does need to be part of the cache key. This means a Credentials' secret, once used with a RequestSigner, will be in process memory until another secret is used with the same request signer instance.
That said, I don't think that's a huge issue at present, since there is seemingly no guarantee of memory cleaning when dropping a Credentials object either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant