GraphiteEditor/Graphite

Restructure JS <-> Wasm communication flow and adopt parallelism

Open

#1,113 建立於 2023年4月11日

在 GitHub 查看
 (3 留言) (0 反應) (2 負責人)Rust (1,176 fork)batch import
Help WantedPerformanceWeb

倉庫指標

Star
 (25,662 star)
PR 合併指標
 (平均合併 6天 9小時) (30 天內合併 65 個 PR)

描述

Right now, JS calls into Wasm, then that calls back into JS again, and that might call back into Wasm, and so on. It does that within the same call stack, so the call stack gets deeper and deeper ping-ponging between the two languages.

We want to flatten this out and build a queue system so either side can queue up tasks. One side processes its queue while building up a queue for the other side, then when done, it switches to the other side and works through its queue on that side, building up tasks for the other side to complete, then it switches again when the queue is done.

We also want to utilize web workers wherever possible to get everything but the DOM manipulations off the main thread, and also benefit where possible from parallelism.

貢獻者指南