Closed berekuk closed 1 year ago
I think we have to go for web workers and shared memory. And we should not bother to support environments where shared memory is not available.
I still think we need all of:
I tried to implement async squiggle code evaluation.
It's not hard technically, but the performance turned out to be prohibitive; it's 20x slower than the sync version for the basic List.upTo(1, n) -> map({|x| x})
benchmark.
There's some potential for optimizations (for example, not all function registry definitions have to be async, only those that take lambdas as a parameter), but I don't expect it to help enough for async to be viable.
Also, supporting both sync and async version would be a pain, we'd have to keep duplicate copy-pasted versions for half of our codebase.
I don't think this is possible anymore. We should start using Web Workers instead.
It'd be nice if
Project.run
had an async interface. Right now evaluations freeze the entire JS thread.There are problems with this (wrapping stuff in promises and passing continuations around is not easy) and we might solve the same issue with web workers. But I'm filing this here for future reference and discussions.