QuTech-Delft / libqasm

libQASM: Library to parse cQASM files
https://arxiv.org/abs/1805.09607
Other
17 stars 16 forks source link

Proof of concept WASM build flags optimization #205

Closed Siilwyn closed 5 months ago

Siilwyn commented 6 months ago

WASM builds comparison

Base -fwasm-exceptions --profiling-funcs -sASSERTIONS=1 -sMODULARIZE=1

JS: 139K, 141k chars WASM: 2.6M

Less: -fwasm-exceptions -sMODULARIZE=1 JS: 105K, 106k chars WASM: 1.8M

Less + Malloc: -fwasm-exceptions -sMODULARIZE=1 -sMALLOC=emmalloc JS: 105K, 106k chars WASM: 1.8M

Less + EXPORT_ES6: -fwasm-exceptions -sMODULARIZE=1 -sEXPORT_ES6=1 JS: 105K, 106k chars WASM: 1.8M

EXPORTES6 + compile flags: -Os JS: 105K, 106k chars WASM: 1.7M

compile flags + environment: -fwasm-exceptions -sMODULARIZE=1 -sEXPORT_ES6=1 -Os -sENVIRONMENT=web JS: 103K, 104k chars WASM: 1.7M

environment + filesystem: -fwasm-exceptions -sMODULARIZE=1 -sEXPORT_ES6=1 -Os -sENVIRONMENT=web -sFILESYSTEM=0 JS: 55k, 55k chars WASM: 1.7M

rturrado commented 5 months ago

These changes finally made it into https://github.com/QuTech-Delft/libqasm/pull/221.