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

Question: WebAssembly support? #6539

Closed
amilajack opened this issue Jul 19, 2016 · 14 comments

Comments

Projects
None yet
8 participants
@amilajack
Copy link

commented Jul 19, 2016

Do the latest versions of electron support WebAssembly?

@sedwards2009

This comment has been minimized.

Copy link

commented Jul 20, 2016

no.

WebAssembly has to be developed in Chrome/Chromium first before it appears in Electron. You can follow the progress here though: https://www.chromestatus.com/features#webassembly

@MarshallOfSound

This comment has been minimized.

Copy link
Member

commented Jul 20, 2016

@sedwards2009 That isn't entirely correct. You can enable WebAssembly with a chromium flag, but I can't figure out which chromium version first supports the flag --enable-webassembly

@amilajack amilajack closed this Jul 20, 2016

@amilajack

This comment has been minimized.

Copy link
Author

commented Jul 20, 2016

@pannous

This comment has been minimized.

Copy link

commented Mar 1, 2017

Using webassembly should somehow be possible by now, right?

@jacobq

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2017

@pannous Not entirely sure, but it appears to be 'enabled by default' in Chrome 57 while Electron v1.6.2 (current at time of writing) uses Chromium 56, so I would think that if it isn't already working out of the box then you could enable it via flag as mentioned earlier.

@adamvoss

This comment has been minimized.

Copy link

commented Apr 19, 2017

@jacobq The flag should exist in the chromium being used, but it is not one of the flags supported by electron.

I tried it by passing the switch anyway and the app ultimately failed indicating there was no native wasm support detected.

@jacobq

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2017

@vossad01 Aw, bummer :(
Maybe we just have to wait for a future version of electron then...

@brenca

This comment has been minimized.

Copy link
Member

commented Apr 19, 2017

I've tried adding app.commandLine.appendSwitch('enable-webassembly') with a branch based on the latest master (v.1.6.7) and this demo seems to be working if I add the flag this way.

@adamvoss

This comment has been minimized.

Copy link

commented Apr 19, 2017

@brenca I just tried that demo it with master (4a9383b), and had it fail. That demo has asm.js fallback, is there any chance you ended up utilizing that?

@adamvoss

This comment has been minimized.

Copy link

commented Apr 20, 2017

I opened #9235 requesting WebAssembly support and outlining what I learned in my investigation of adding it to electron.

@brenca

This comment has been minimized.

Copy link
Member

commented Apr 20, 2017

Yeah, I see the problem too with your original test.

@adamvoss

This comment has been minimized.

Copy link

commented May 23, 2017

WebAssembly is available as of Electron 1.7.0

@asbjornu

This comment has been minimized.

Copy link

commented Aug 1, 2017

Is it possible for parts of Electron apps (such as Atom and Slack) themselves to be written in WebAssembly so a reduction in CPU and RAM consumption can be achieved? Can WebAssembly be utilised in other ways to reduce the CPU and RAM footprint of Electron apps?

@adamvoss

This comment has been minimized.

Copy link

commented Aug 1, 2017

Is it possible for parts of Electron apps (such as Atom and Slack) themselves to be written in WebAssembly

Technically yes, though (barring a development I am unaware of) the interop between WASM and JavaScript (i.e. the electron apis) can be a bit tedious which may factor in to how you architect your components.

so a reduction in CPU and RAM consumption can be achieved?

WebAssembly is not a magic solution. It would be perfectly possible to write a less efficient implementation compile it to WebAssembly and be worse off. However, the languages that currently support WebAssembly are lower-level languages the give you greater control over memory and execution characteristics, so in theory you should be able to write more efficient implementations (as always, you will need to measure your specific use case).

Can WebAssembly be utilised in other ways to reduce the CPU and RAM footprint of Electron apps?

You have already mentioned writing parts of applications in WebAssembly, so I am not sure what else there would be. I suppose you could use a WebAssembly component to replace some part of Electron itself if you found something that you could optimize that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.