Skip to content

Conversation

@achingbrain
Copy link
Member

@chainsafe/noise has an optimisation where the buffer containing incoming encrypted data is reused for the decrypted data to avoid allocing a new buffer.

This data arrives as a Uint8ArrayList so where it spans more than one buffer it can involve copying the data first, only to then overwrite it.

This experiment tests:

  • v1.0: default behaviour
  • v1.0-noise-alloc: use alloc unsafe to allocate a new unitialised buffer
  • v1.0-noise-alloc-smart: only alloc unsafe if the list contains more than one buffer

achingbrain and others added 2 commits December 2, 2023 07:22
`@chainsafe/noise` has an optimisation where the buffer containing
incoming encrypted data is reused for the decrypted data to avoid
allocing a new buffer.

This data arrives as a `Uint8ArrayList` so where it spans more than
one buffer it can involve copying the data first, only to then
overwrite it.

This experiment tests:

- v1.0: default behaviour
- v1.0-noise-alloc: use alloc unsafe to allocate a new unitialised buffer
- v1.0-noise-alloc-smart: only alloc unsafe if the list contains more than one buffer
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2023

@dhuseby dhuseby added the perf Related to perf tests label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf Related to perf tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants