tools
tools copied to clipboard
📎 Split playground `run` function
Description
We've amassed quite a few views in the playground. Any more and we'll run into performance as well as usability issues.
One issue that adds to this is the run function in playground/src/lib.rs. It computes the data for all of the views at once. This isn't efficient as only one view is visible at a time. Instead we should have separate functions for each view, that way we can only compute that data.
However, we need to be a little careful, as passing the string from JavaScript to WebAssembly is very inefficient. Perhaps there is a way to persist the string on the Rust side and only update it when necessary. Alternatively, one could prove that this passing of the string is not a big deal (very possible!).