Skip to content

Commit

Permalink
Reduce binary size to ~1MB
Browse files Browse the repository at this point in the history
- Recompiled main.cpp with -s WASM=1
- Recompiled FFTW with O3 flag
  • Loading branch information
ggerganov committed May 21, 2018
1 parent 14cf221 commit f1aad28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion compile.sh
Expand Up @@ -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",
Expand Down

0 comments on commit f1aad28

Please sign in to comment.