Commit 9b7de5c
perf(ui): use startTransition for dimension changes instead of RAF batch
The previous RAF-based dimension batching collected all dimension changes
and flushed them in a single commit. Profiling showed this created a
190ms jank (commit #55) — worse than the original 8 × ~20ms spread across
multiple frames.
Replace with a simpler approach: wrap dimension changes in
React.startTransition so React schedules them at lower priority. This
avoids concentrating all dimension work into one frame while still keeping
interactive changes (select, drag, remove) immediate.
Also keeps the merged startTransition for setNodes+setEdges in
applyPatch (from the previous commit) which avoids double renders
from the subscription path.
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>1 parent 88ea511 commit 9b7de5c
1 file changed
+10
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
1507 | 1504 | | |
1508 | 1505 | | |
1509 | 1506 | | |
| |||
1517 | 1514 | | |
1518 | 1515 | | |
1519 | 1516 | | |
1520 | | - | |
1521 | 1517 | | |
1522 | 1518 | | |
1523 | 1519 | | |
1524 | 1520 | | |
1525 | | - | |
1526 | 1521 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1540 | 1525 | | |
1541 | 1526 | | |
1542 | 1527 | | |
| |||
3047 | 3032 | | |
3048 | 3033 | | |
3049 | 3034 | | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | 3035 | | |
3057 | 3036 | | |
3058 | 3037 | | |
| |||
0 commit comments