Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a WebAssembly version of sql.js? #219

Closed
Taytay opened this issue Nov 3, 2017 · 10 comments · Fixed by #255
Closed

Is there a WebAssembly version of sql.js? #219

Taytay opened this issue Nov 3, 2017 · 10 comments · Fixed by #255

Comments

@Taytay
Copy link
Contributor

Taytay commented Nov 3, 2017

I have a limited understanding of WebAssembly, but my understanding is that we'd see better performance if this was actually compiled directly to WebAssembly, rather than "only" asm.js. If that's correct, has anyone made the edits to the toolchain to support it, or are there pre-compiled files available on any of this projects' branches? If I wanted to look into doing so, can anyone point me in the right direction to begin digging in?

@kripken
Copy link
Collaborator

kripken commented Nov 3, 2017

To try it, you need to pass -s WASM=1 to emcc. Issues that you might need to deal with are that there will be another output file, a .wasm (which you can avoid with -s SINGLE_FILE=1 but it's less efficient), and that startup may be async (as wasm compilation is async).

@Taytay
Copy link
Contributor Author

Taytay commented Nov 3, 2017

Thank you sir! Much appreciated!

@mikeptweet
Copy link

Did you get a WebAssembly version to work?

@sebastianmacias
Copy link

I'm also looking forward to this.

@YagoLopez
Copy link

Me too

@Taytay
Copy link
Contributor Author

Taytay commented Sep 2, 2018

I haven’t even attempted this since I asked
:(

I did stumble across this project though in a recent search: https://github.com/mandel59/sqlite-wasm

It’s not active but maybe that’s because it just works @mandel59?

@Taytay
Copy link
Contributor Author

Taytay commented Nov 1, 2018

I've started work on this, and have a work-in-progress branch here: https://github.com/Taytay/sql.js/tree/wasm

It depends on other non-wasm fixes I've made here: https://github.com/Taytay/sql.js/tree/fix/async_loading

More details, and a PR to come.

@Taytay
Copy link
Contributor Author

Taytay commented Nov 2, 2018

@Taytay
Copy link
Contributor Author

Taytay commented Nov 5, 2018

And if folks are reading this, they might be interested in another branch I've started where I'm trying to optimize things. So far, I've gotten the .wasm file down to 571KB: Taytay#1

@sebastianmacias
Copy link

And if folks are reading this, they might be interested in another branch I've started where I'm trying to optimize things. So far, I've gotten the .wasm file down to 571KB: Taytay#1

Good work! I will keep watching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants