Closed selasijean closed 1 month ago
Miscellaneous and probably doesn't affect anything
We have
func (b *bind[A, B]) scopeHeight() int { return b.lhs.Node().height }
instead of
func (b *bind[A, B]) scopeHeight() int { return b.lhsChange.Node().height }
per the JS impl
Deliberate?
Addressed by #24
@wcharczuk
So I noticed some performance issues that I wanted to flag and bring to your attention. Running the simple benchmark tests defined below,
Benchmark_SimpleReverse
took unreasonably long to complete (~13s) vrsBenchmark_Simple
which took ~0.5s. The expectation was thatBenchmark_SimpleReverse
would be at least slightly slower since it will deal with a lot of nodes in the recompute heap during the first stabilization.Investigating further, I noticed that we were spending a long time in the adjustHeightHeap, and so I changed
for x := 0; x <= ah.maxHeightSeen; x++
tofor x := ah.heightLowerBound; x <= ah.maxHeightSeen; x++ {
to match the JS implementation and the change madeBenchmark_SimpleReverse
take 1s to complete(a 13x speedup).I noticed the comment:
I don't think this change at the detriment of regular Stabilize, which is used more is worth it. Lmk what you think.