perf(tui): skip cached rounding subtrees before descent
This commit is contained in:
@@ -979,13 +979,6 @@ function layoutNode(
|
||||
|
||||
if (performLayout) {
|
||||
node._rLayoutGen = _generation
|
||||
|
||||
let ancestor: Node | null = node
|
||||
|
||||
while (ancestor && ancestor._rSubtreeLayoutGen !== _generation) {
|
||||
ancestor._rSubtreeLayoutGen = _generation
|
||||
ancestor = ancestor.parent
|
||||
}
|
||||
}
|
||||
|
||||
const style = node.style
|
||||
@@ -1056,6 +1049,15 @@ function layoutNode(
|
||||
}
|
||||
}
|
||||
|
||||
if (performLayout) {
|
||||
let ancestor: Node | null = node
|
||||
|
||||
while (ancestor && ancestor._rSubtreeLayoutGen !== _generation) {
|
||||
ancestor._rSubtreeLayoutGen = _generation
|
||||
ancestor = ancestor.parent
|
||||
}
|
||||
}
|
||||
|
||||
const wasDirty = node.isDirty_
|
||||
|
||||
if (performLayout) {
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('incremental layout rounding', () => {
|
||||
expect(clock.getComputedWidth()).toBe(6.5)
|
||||
expect(transcript.getComputedWidth()).toBe(transcriptWidth)
|
||||
expect(counters.rounded).toBeLessThanOrEqual(4)
|
||||
expect(counters.roundSkips).toBeGreaterThanOrEqual(1)
|
||||
expect(counters.roundSkips).toBe(1)
|
||||
|
||||
root.freeRecursive()
|
||||
Yoga.Config.destroy(config)
|
||||
|
||||
Reference in New Issue
Block a user