forked from external-repos/squoosh
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26e9a848dd |
@@ -14,5 +14,10 @@ RUN rustup install nightly && \
|
|||||||
cargo install wasm-pack
|
cargo install wasm-pack
|
||||||
|
|
||||||
COPY --from=0 /opt/wabt /opt/wabt
|
COPY --from=0 /opt/wabt /opt/wabt
|
||||||
ENV PATH="/opt/wabt/bin:${PATH}"
|
|
||||||
|
RUN mkdir /opt/binaryen && \
|
||||||
|
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.38.32/binaryen-1.38.32-x86-linux.tar.gz | tar -xzf - -C /opt/binaryen --strip 1
|
||||||
|
|
||||||
|
ENV PATH="/opt/binaryen:/opt/wabt/bin:${PATH}"
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ echo "============================================="
|
|||||||
(
|
(
|
||||||
rustup run nightly \
|
rustup run nightly \
|
||||||
wasm-pack build --target no-modules
|
wasm-pack build --target no-modules
|
||||||
|
mv pkg/squooshhqx_bg.wasm pkg/squooshhqx_bg.unopt.wasm
|
||||||
|
wasm-opt -Os --no-validation pkg/squooshhqx_bg.unopt.wasm -o pkg/squooshhqx_bg.wasm
|
||||||
wasm-strip pkg/squooshhqx_bg.wasm
|
wasm-strip pkg/squooshhqx_bg.wasm
|
||||||
rm pkg/.gitignore
|
rm pkg/.gitignore
|
||||||
)
|
)
|
||||||
|
|||||||
11
codecs/hqx/loading_benchmark.js
Normal file
11
codecs/hqx/loading_benchmark.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
// THIS IS NOT A NODE SCRIPT
|
||||||
|
// This is a d8 script. Please install jsvu[1] and install v8.
|
||||||
|
// Then run `npm run --silent benchmark`.
|
||||||
|
// [1]: https://github.com/GoogleChromeLabs/jsvu
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
const start = Date.now();
|
||||||
|
const module = await WebAssembly.compile(readbuffer("pkg/squooshhqx_bg.wasm"));
|
||||||
|
print(`${Date.now()/1000 - start/1000}`);
|
||||||
|
}
|
||||||
|
init().catch(e => console.error(e.stack));
|
||||||
Binary file not shown.
Reference in New Issue
Block a user