Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: minimal memory allocation on ViewDU hashTreeRoot #388

Merged
merged 12 commits into from
Jul 23, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jul 23, 2024

Motivation

Right now HashComputationGroup is allocated every time we call ViewDU.hashTreeRoot(), we need design the api to allow consumer to preallocate it to save more memory allocation

see #386

Description

  • refactor HashComputationLevel to use LinkedList, this will allocate minimal memory when it wants to grow
  • do not allocate temporary array in hashtree.ts
  • do not allocate temporary objects in ViewDU.commit()

Closes #386

@twoeths twoeths changed the title Te/minimal alloc viewdu batch hash feat: minimal memory allocation on ViewDU hashTreeRoot Jul 23, 2024
@twoeths twoeths marked this pull request as ready for review July 23, 2024 07:14
@twoeths twoeths requested a review from a team as a code owner July 23, 2024 07:14
@twoeths
Copy link
Contributor Author

twoeths commented Jul 23, 2024

  • got 2 spikes in the last 19h
Screenshot 2024-07-23 at 14 16 24

vs 8 spikes at the other node running te/batch_hash_tree_root, and 3 spikes on stable-1k

  • average hash_tree_root of prepare_next_epoch flow in this branch
Screenshot 2024-07-23 at 14 18 37
  • vs te/batch_hash_tree_root
Screenshot 2024-07-23 at 14 19 09

@twoeths twoeths merged commit b6f18fb into te/batch_hash_tree_root Jul 23, 2024
8 checks passed
@twoeths twoeths deleted the te/minimal_alloc_viewdu_batch_hash branch July 23, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant