-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Description
With #2406 merged, we got the basic API shape in and functioning. As follow up work, there are a few places we can optimize for better performance:
- Skip the
Resetafter performing a one-shot operation. Since it's only used one time, there is no point of performing a reset right before it gets disposed. - Skip allocating an IV when possible.
Unix and macOS don't need a copy of the IV since it's only used during initialization and their native APIs create copy themselves for internal use when performing update / final.
Windows requires passing the IV to each call, expecting the callers to track the IV between updates. But we don't need to support transferring this between calls to update, so it can be stack allocated. - Cache algorithm instance handles but remain thread safe. We could store the handles in a
ThreadLocalor similar.
GSPP and PaulusParssinenSergio0694, GSPP and PaulusParssinenSergio0694, GSPP and PaulusParssinen