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(perf): speed up construction of bbjs Frs & cache zero hashes in ephemeral trees #11851

Merged
merged 5 commits into from
Feb 10, 2025

Conversation

dbanks12
Copy link
Collaborator

@dbanks12 dbanks12 commented Feb 8, 2025

Improves time for tx-hash computation from ~26-35ms down to ~20-23ms. This is because we were doing slower conversion of 1800+ Uint8Arrays to Frs. Allowing them to be actual Buffers lets us use read/writeBigUint64 functions which are faster than the per-byte shifting we were doing.

Cache zero-hashes in static member of ephemeral tree class. Brings Ephemeral forest construction from 20ms down to 10ms.

Copy link
Collaborator Author

dbanks12 commented Feb 8, 2025

Base automatically changed from db/avm-test-fix to master February 9, 2025 13:02
dbanks12 and others added 2 commits February 10, 2025 09:43
Cache zero-hashes in static member of ephemeral tree class. Brings
Ephemeral forest construction from 20ms down to 10ms.
@dbanks12 dbanks12 changed the title feat(perf): speed up construction of bbjs Frs feat(perf): speed up construction of bbjs Frs & cache zero hashes in ephemeral trees Feb 10, 2025
@dbanks12 dbanks12 merged commit 2b5afe3 into master Feb 10, 2025
53 checks passed
@dbanks12 dbanks12 deleted the db/ts-fr-hash-opts branch February 10, 2025 19:19
ludamad added a commit that referenced this pull request Feb 10, 2025
…ro hashes in ephemeral trees" (#11893)

Reverts #11851

It broke bb.js tests, which never ran
sklppy88 pushed a commit that referenced this pull request Feb 10, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.76.1</summary>

##
[0.76.1](aztec-package-v0.76.0...aztec-package-v0.76.1)
(2025-02-10)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.76.1</summary>

##
[0.76.1](barretenberg.js-v0.76.0...barretenberg.js-v0.76.1)
(2025-02-10)


### Features

* **perf:** Speed up construction of bbjs Frs & cache zero hashes in
ephemeral trees
([#11851](#11851))
([2b5afe3](2b5afe3))


### Bug Fixes

* Revert "feat(perf): speed up construction of bbjs Frs & cache zero
hashes in ephemeral trees"
([#11893](#11893))
([99fdab9](99fdab9))
</details>

<details><summary>aztec-packages: 0.76.1</summary>

##
[0.76.1](aztec-packages-v0.76.0...aztec-packages-v0.76.1)
(2025-02-10)


### Features

* **perf:** Speed up construction of bbjs Frs & cache zero hashes in
ephemeral trees
([#11851](#11851))
([2b5afe3](2b5afe3))


### Bug Fixes

* Actually fix pxe releases
([#11890](#11890))
([b22c9b9](b22c9b9))
* Bb pattern
([9fcff50](9fcff50))
* Revert "feat(perf): speed up construction of bbjs Frs & cache zero
hashes in ephemeral trees"
([#11893](#11893))
([99fdab9](99fdab9))


### Miscellaneous

* Add blob lib to npm deploy
([#11891](#11891))
([bc10f17](bc10f17))
</details>

<details><summary>barretenberg: 0.76.1</summary>

##
[0.76.1](barretenberg-v0.76.0...barretenberg-v0.76.1)
(2025-02-10)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this pull request Feb 11, 2025
…ro hashes in ephemeral trees" (#11893)

Reverts AztecProtocol/aztec-packages#11851

It broke bb.js tests, which never ran
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Feb 11, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.76.1</summary>

##
[0.76.1](AztecProtocol/aztec-packages@aztec-package-v0.76.0...aztec-package-v0.76.1)
(2025-02-10)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.76.1</summary>

##
[0.76.1](AztecProtocol/aztec-packages@barretenberg.js-v0.76.0...barretenberg.js-v0.76.1)
(2025-02-10)


### Features

* **perf:** Speed up construction of bbjs Frs & cache zero hashes in
ephemeral trees
([#11851](AztecProtocol/aztec-packages#11851))
([2b5afe3](AztecProtocol/aztec-packages@2b5afe3))


### Bug Fixes

* Revert "feat(perf): speed up construction of bbjs Frs & cache zero
hashes in ephemeral trees"
([#11893](AztecProtocol/aztec-packages#11893))
([99fdab9](AztecProtocol/aztec-packages@99fdab9))
</details>

<details><summary>aztec-packages: 0.76.1</summary>

##
[0.76.1](AztecProtocol/aztec-packages@aztec-packages-v0.76.0...aztec-packages-v0.76.1)
(2025-02-10)


### Features

* **perf:** Speed up construction of bbjs Frs & cache zero hashes in
ephemeral trees
([#11851](AztecProtocol/aztec-packages#11851))
([2b5afe3](AztecProtocol/aztec-packages@2b5afe3))


### Bug Fixes

* Actually fix pxe releases
([#11890](AztecProtocol/aztec-packages#11890))
([b22c9b9](AztecProtocol/aztec-packages@b22c9b9))
* Bb pattern
([9fcff50](AztecProtocol/aztec-packages@9fcff50))
* Revert "feat(perf): speed up construction of bbjs Frs & cache zero
hashes in ephemeral trees"
([#11893](AztecProtocol/aztec-packages#11893))
([99fdab9](AztecProtocol/aztec-packages@99fdab9))


### Miscellaneous

* Add blob lib to npm deploy
([#11891](AztecProtocol/aztec-packages#11891))
([bc10f17](AztecProtocol/aztec-packages@bc10f17))
</details>

<details><summary>barretenberg: 0.76.1</summary>

##
[0.76.1](AztecProtocol/aztec-packages@barretenberg-v0.76.0...barretenberg-v0.76.1)
(2025-02-10)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
ludamad added a commit that referenced this pull request Feb 11, 2025
…ephemeral trees (redo) (#11894)

Redo of #11851

---------

Co-authored-by: dbanks12 <david@aztecprotocol.com>
Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this pull request Feb 12, 2025
…ephemeral trees (redo) (#11894)

Redo of AztecProtocol/aztec-packages#11851

---------

Co-authored-by: dbanks12 <david@aztecprotocol.com>
Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
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.

3 participants