pretty good optimization! I'm definitely going to dig into the code further when i get a chance (and see if i can make a webgl+gpgpu version). A couple of things that jumped out to me as i was reading the code -
* architecture is very solid, i can't suggest any improvements
* like the URL.createObjectURL(new Blob(["(" + fn + ")()"])) approach
* maybe is a confusing variable name, maybe something more descriptive like noWorkers
* pointer at line 446 vs pointer on line 463, they seem to be 2 different things with the same name, which is confusing
* i like that theLastExperience is where all of the worker code is, easy to know where the code i'm looking at will run thanks to the extra level of indentation
Another cool side effect I like : Worker threads are secured by design, running in a dedicated global scope. Code can’t be manipulated remotely, i.e. killing requestAnimationFrame and all those things CodePen does.