test-plans icon indicating copy to clipboard operation
test-plans copied to clipboard

experiment: alloc uninitialised buffer for incoming decrypted data

Open achingbrain opened this issue 2 years ago • 1 comments

@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 avatar Dec 02 '23 07:12 achingbrain

See new metrics at https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=97e42f43325c9e780529dd0cb8948caf51eb9086

github-actions[bot] avatar Dec 02 '23 07:12 github-actions[bot]