|
|
|
|
|
by jewel
4128 days ago
|
|
Would it work to have the data structures be copy-on-write? That way if the worker only reads then it's O(1), you just pass a reference to the worker. I imagine it'd be a pain to write a garbage collector for something like that. |
|
However, copy on write still requires allocation and for some applications that is a deal breaker.
1: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...