Ok, here's what I found out :)
- the file is 9 MB because of the embedded gl.xml file... this is about 2.7 MB but gets blown up when embedded in to the asm.js (probably because of base64 encoding and extra commas)
- the way the program is currently compiled, everything is in the .html file, and it looks like your web servers doesn't compress .html (fixing the server-side compression would be the most important thing to fix, if you have access to the web server configuration)
- I played around with the compile options, first that the gl.xml is put into a separate binary file (this reduces the size from 9 MB to the 2.7 MB of the original gl.xml file), and some other options to reduce the size of the generated asm.js code.
The command line is (I've put this into a build_emsc.sh file)
em++ galogen.cpp third_party/tinyxml2.cpp -fno-rtti -fno-exceptions -std=c++11 -stdlib=libc++ -o galogen.html -Os --llvm-lto 1 -DNDEBUG -s WASM=0 --shell-file galogen-shell.html -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING