Reducing binary size (for emscripten)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reducing binary size (for emscripten)

Sebastian Gsänger
Hi,

i have written some qi-parsers i'd like to include in a web-application via emscripten.
Unfortunately, i seem to be unable to reach acceptable-file sizes, with even simple parsers reaching multiple megabytes.

Has anyone experience with spirit+emscripten?
And are there some general do-s and don't-s i should learn about,
maybe some clang-specific tips?

Thanks,
Sebastian

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reducing binary size (for emscripten)

chris beck
Hi,

I'm also hoping to use qi parsers I wrote with emscripten.

Do you have any examples you can show? I agree that a simple qi parser should not lead to multiple megabytes of js, maybe there is some build option that can help? For instance are you using c++ exceptions in your parsers, and if not are you making sure emscripten turns that off? That can have a very large impact on js size.

Chris

On Jul 27, 2017 8:04 AM, "Sebastian Gsänger" <[hidden email]> wrote:
Hi,

i have written some qi-parsers i'd like to include in a web-application via emscripten.
Unfortunately, i seem to be unable to reach acceptable-file sizes, with even simple parsers reaching multiple megabytes.

Has anyone experience with spirit+emscripten?
And are there some general do-s and don't-s i should learn about,
maybe some clang-specific tips?

Thanks,
Sebastian

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reducing binary size (for emscripten)

Sebastian Gsänger
As you can see i don't use any exceptions there besides what spirit does behind the curtains.
I guess the expectation parser makes my grammar very expectation heavy, but changing it would complicate the overall grammar tremendously.
On the emscripten side, according to the documentation (http://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-Code.html#other-optimization-issues), optimization levels other than -O0 disable C++ exceptions completely.
(I guess i should evaluate whether this invalidates my grammar before caring about filesize :D But so far it still works...)
Nevertheless, whether it's -O2 or -Os or -Oz, the pwinput-parser never drops below 3MB, considering that i want to add many more parsers that's not a good outlook.

Sebastian

2017-07-27 19:06 GMT+02:00 Chris Beck <[hidden email]>:
Hi,

I'm also hoping to use qi parsers I wrote with emscripten.

Do you have any examples you can show? I agree that a simple qi parser should not lead to multiple megabytes of js, maybe there is some build option that can help? For instance are you using c++ exceptions in your parsers, and if not are you making sure emscripten turns that off? That can have a very large impact on js size.

Chris

On Jul 27, 2017 8:04 AM, "Sebastian Gsänger" <[hidden email]> wrote:
Hi,

i have written some qi-parsers i'd like to include in a web-application via emscripten.
Unfortunately, i seem to be unable to reach acceptable-file sizes, with even simple parsers reaching multiple megabytes.

Has anyone experience with spirit+emscripten?
And are there some general do-s and don't-s i should learn about,
maybe some clang-specific tips?

Thanks,
Sebastian

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Loading...