8000 WASM future? · Issue #112 · d3/d3-force · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WASM future? #112

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

Closed
Jamtis opened this issue Jan 31, 2018 · 4 comments
Closed

WASM future? #112

Jamtis opened this issue Jan 31, 2018 · 4 comments

Comments

@Jamtis
Copy link
Jamtis commented Jan 31, 2018

Hi there,

I was using a WebWorker with a SharedArrayBuffer to do the math for the graph in my app.
(Un)fortunately, SharedArrayBuffer has been disabled in response to Spectre.

So, as I was looking for an alternative (except normal ArrayBuffer - memory copying), I figured that SIMD has been dropped in favor of WASM which reached consensus and landed in all relevant browsers.

Are there plans to port to WASM? This project seems like a natural fit for WASM.
I found https://github.com/ColinEberhardt/d3-wasm-force which looks like a proof-of-concept to me but has no pulse atm.

In general, which method is advised to optimize performance?

  1. Main thread
  2. WebWorker with ArrayBuffer (copying)
  3. WebWorker with SharedArrayBuffer (non-copying)
  4. WASM in the main thread
  5. WASM in WebWorker
  6. ???

Thanks in advance for the comments.

@pvorona
Copy link
pvorona commented Aug 12, 2018

I had similar issue. Running huge simulations (~15k nodes) in web worker generaly helps.

@alexburner
Copy link
alexburner commented Oct 11, 2018

I too have had good luck with running large simulations in a separate web worker

I'd also like to explore using navigator.hardwareConcurrency to spread the simulation calculations across an appropriate number of child workers (by splitting the nodes list into chunks?), but haven't had time to explore this option yet

@Jamtis
Copy link
Author
Jamtis commented Oct 15, 2018

SharedArrayBuffer has been re-enabled in Chrome 67 in light of site isolation.

@mbostock
Copy link
Member

I have no plans to port to WASM, but feel free to fork this library if it helps!

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

No branches or pull requests

4 participants
0