Reduce binary size to ~1MB

- Recompiled main.cpp with -s WASM=1
- Recompiled FFTW with O3 flag
This commit is contained in:
Georgi Gerganov
2018-05-21 18:48:39 +03:00
parent 14cf221875
commit f1aad28b21
2 changed files with 2 additions and 2 deletions

View File

@@ -71,5 +71,5 @@ To build this project you need Emscripten compiler. Additionally, you need [FFTW
- Ultrasonic sound transmission does not work on most devices. Probably hardware limitations?
- In presence of multiple local networks, cannot currently select which one to use. Always the first one is used
- There is occasionally sound cracking during transmission. Need to optimize the Tx code
- The size of the emscripten generated .js is too big (~4MB). Rewrite in pure JS?
- The size of the emscripten generated .js is too big (~1MB). Rewrite in pure JS?
- On mobile, using Firefox, the page can remain running in the background even after closing the tab

View File

@@ -2,7 +2,7 @@
echo "static const char * BUILD_TIMESTAMP=\"`date`\";" > build_timestamp.h
em++ -Wall -Wextra -O3 -std=c++11 -s USE_SDL=2 ./main.cpp -o wave.js -I ./fftw-3.3.3/api ./lib/libfftw3f.a \
em++ -Wall -Wextra -O3 -std=c++11 -s USE_SDL=2 -s WASM=1 ./main.cpp -o wave.js -I ./fftw-3.3.3/api ./lib/libfftw3f.a \
-s EXPORTED_FUNCTIONS='["_getText", "_getSampleRate", "_setText", "_getAverageRxTime_ms", "_setParameters",
"_getFramesLeftToRecord", "_getFramesToRecord",
"_getFramesLeftToAnalyze", "_getFramesToAnalyze",