-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensures wasms are stripped of debug info to reduce size. Gzips them for inlining into the webpack bundle. Bundle is now 6.8MB.
- Loading branch information
1 parent
133384c
commit 62a6b66
Showing
21 changed files
with
6,704 additions
and
3,940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
acir_tests | ||
acir_tests | ||
**/.yarn/* | ||
!**/.yarn/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
(cd headless-test && yarn && npx playwright install && npx playwright install-deps) | ||
(cd browser-test-app && yarn && yarn build) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
7,591 changes: 4,618 additions & 2,973 deletions
7,591
barretenberg/acir_tests/browser-test-app/yarn.lock
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,991 changes: 2,046 additions & 945 deletions
2,991
barretenberg/acir_tests/headless-test/yarn.lock
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
(cd ./build-wasm/bin && gzip barretenberg.wasm -c > barretenberg.wasm.gz) | ||
(cd ./build-wasm-threads/bin && gzip barretenberg.wasm -c > barretenberg.wasm.gz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/bin/sh | ||
/opt/wasi-sdk/bin/llvm-strip ./build-wasm/bin/barretenberg.wasm | ||
# TODO(https://github.com/AztecProtocol/barretenberg/issues/941) We currently do not strip barretenberg threaded wasm, for stack traces. | ||
# /opt/wasi-sdk/bin/llvm-strip ./build-wasm-threads/bin/barretenberg.wasm | ||
/opt/wasi-sdk/bin/llvm-strip ./build-wasm-threads/bin/barretenberg.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
barretenberg/ts/src/barretenberg_wasm/barretenberg-threads.wasm
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
barretenberg/ts/src/barretenberg_wasm/barretenberg-threads.wasm.gz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../cpp/build-wasm-threads/bin/barretenberg.wasm.gz |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../cpp/build-wasm/bin/barretenberg.wasm.gz |
9 changes: 6 additions & 3 deletions
9
barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import barretenbergModule from '../../barretenberg.wasm'; | ||
import barretenbergThreadsModule from '../../barretenberg-threads.wasm'; | ||
import barretenbergModule from '../../barretenberg.wasm.gz'; | ||
import barretenbergThreadsModule from '../../barretenberg-threads.wasm.gz'; | ||
import pako from 'pako'; | ||
|
||
// Annoyingly the wasm declares if it's memory is shared or not. So now we need two wasms if we want to be | ||
// able to fallback on "non shared memory" situations. | ||
export async function fetchCode(multithreaded: boolean) { | ||
const res = await fetch(multithreaded ? barretenbergThreadsModule : barretenbergModule); | ||
return await res.arrayBuffer(); | ||
const compressedData = await res.arrayBuffer(); | ||
const decompressedData = pako.ungzip(new Uint8Array(compressedData)); | ||
return decompressedData.buffer; | ||
} |
2 changes: 1 addition & 1 deletion
2
barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/wasm-module.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
declare module '*.wasm' { | ||
declare module '*.wasm.gz' { | ||
const content: string; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62a6b66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.wasmconstruct_proof_ultrahonk_power_of_2/20
16347.593065000001
ms/iter15240.000718
ms/iter1.07
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ludamad @codygunton