fitzgen / dodrio

A fast, bump-allocated virtual DOM library for Rust and WebAssembly.
https://docs.rs/dodrio
Mozilla Public License 2.0
1.24k stars 49 forks source link

Dodrio in web worker #127

Open olanod opened 4 years ago

olanod commented 4 years ago

Would it be feasible to make Dodrio run in a web worker by doing the diffing and everything else in the worker and only applying the change list in the main thread? perhaps the bridging can use a SharedArrayBuffer if available or some efficient serialization mechanism also used to bridge user evens :thinking:

frank-dspeed commented 4 years ago

you need to keep in mind the cost of serialization and deserialization in general that is possible but it would need some more logic. An Implementation that would sync the whole dom tree would be slow probably at scale.

I have found only one Algo that would work in that scenario but it is highly experimental research.

I hook into the MutationObserver for the DOM and sync that Batched Changes to WASM which gets on Init the Intal dom + changes.