memoization of step heaps, effectively preallocating weak arrays
this is another performance improvement suggestion. it's entirely possible that this breaks the JS backend. i have not tried.
weak array creations are reduced further by keeping old weak array heaps from previous steps around in a primitive stack. in my benchmarks where steps are fired in a tight loop, the commit cee407f decreased the runtime of a simulation between 20 and 40%. similar improvements are also seen in the minibenchmark https://gist.github.com/nilsbecker/2ec8d0a136e2fcc20184#file-react_minibenchmark-ml . compared to react 1.2.0, in my specific use cases, this in some cases gives a speedup of around 2 times.
might be considered evil
It's not evil but it invalidates the thread safety properties mentioned in the documentation... Interesting though.
i see. i guess to make something like this thread safe it would be better to work with immutable values? not sure how this would be done, or whether it can be done efficiently. about speed: i noticed that the speedup factor is larger when the call graph is small. it seems that a constant, relatively small overhead per step creation is removed, and this is most noticeable for small call graphs.