test(tree): Re-enable commented-out table benchmarks#27227
test(tree): Re-enable commented-out table benchmarks#27227Josmithr wants to merge 3 commits intomicrosoft:mainfrom
Conversation
… row removal on columns" This reverts commit 4160469.
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (746 lines, 2 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
This PR re-enables previously commented-out SharedTree “table” benchmarks (both duration and memory) related to undo/redo scenarios, aligning with AB#43364.
Changes:
- Re-enabled multiple undo/redo benchmark cases in the execution-time suite for table operations (insert/remove column/row, including combined scenarios).
- Re-enabled corresponding redo-focused memory-usage benchmarks for similar table operation patterns.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| packages/dds/tree/src/test/shared-tree/tableTree.bench.ts | Re-enables several previously disabled duration benchmarks for undo/redo table operations. |
| packages/dds/tree/src/test/memory/tableTree.spec.ts | Re-enables several previously disabled memory benchmarks for redo (and related) table operations. |
| runBenchmark({ | ||
| title: `Redo: Remove a column and a row in the middle ${count} times`, | ||
| tableSize, | ||
| initialCellValue, | ||
| beforeOperation: (table, undoRedoManager) => { | ||
| for (let i = 0; i < count; i++) { | ||
| const column = table.columns[Math.floor(table.columns.length / 2)]; | ||
| const row = table.rows[Math.floor(table.rows.length / 2)]; | ||
| table.removeColumns([column]); | ||
| table.removeRows([row]); | ||
| } | ||
| for (let i = 0; i < count; i++) { | ||
| // Undo remove row | ||
| undoRedoManager.undo(); | ||
| // Undo remove column | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); | ||
| assert(undoRedoManager.canRedo); | ||
| }, | ||
| operation: (_table, undoRedoManager) => { | ||
| for (let i = 0; i < count; i++) { | ||
| // Redo remove row | ||
| undoRedoManager.redo(); | ||
| // Redo remove column | ||
| undoRedoManager.redo(); | ||
| } | ||
| }, | ||
| afterOperation: (_table, undoRedoManager) => { | ||
| assert(!undoRedoManager.canRedo); | ||
| }, | ||
| maxBenchmarkDurationSeconds, | ||
| }); |
| // Redo remove row | ||
| undoRedoManager.redo(); | ||
| // Redo remove column | ||
| undoRedoManager.redo(); |
| undoRedoManager.undo(); | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); |
| // Undo column insertion | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); |
| for (let i = 0; i < count; i++) { | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); |
| // Undo column removal | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); |
| // Undo column insertion | ||
| undoRedoManager.undo(); | ||
| } | ||
| assert(!undoRedoManager.canUndo); |
AB#43364