Skip to content
Closed
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a920d4f
refactor: Extract interface
Josmithr Jul 31, 2025
968c35a
docs: Update comments
Josmithr Jul 31, 2025
cbe3972
refactor: Small cleanup
Josmithr Jul 31, 2025
de9f281
refactor: Unify helpers
Josmithr Jul 31, 2025
9a7634f
style: Line break
Josmithr Jul 31, 2025
37691d7
refactor: Rename variables
Josmithr Jul 31, 2025
6a8b9db
test: Improve validation patterns
Josmithr Jul 31, 2025
e17f456
refactor: Remove duplicate assertion
Josmithr Aug 4, 2025
767fbaa
refactor: Use interface instead of class
Josmithr Aug 4, 2025
8f263ea
test: Add event listeners
Josmithr Aug 4, 2025
be4c707
refactor: Use interface instead of class
Josmithr Aug 4, 2025
3a99c23
refactor: Use common helper base
Josmithr Aug 4, 2025
81976cf
refactor: Remove unnecessary parameters
Josmithr Aug 4, 2025
7764ec1
refactor: Shared interface definitions
Josmithr Aug 4, 2025
7741eef
docs: TODOs
Josmithr Aug 4, 2025
2cfd250
Merge branch 'main' into table-perf-test-updates
Josmithr Aug 11, 2025
7a83a17
refactor: Unify argument names
Josmithr Aug 11, 2025
c9eeebd
refactor: Dedupe option properties
Josmithr Aug 11, 2025
8a946c4
refactor: Small initialization optimization
Josmithr Aug 11, 2025
37b5795
refactor: Add options type and allow sparse table
Josmithr Aug 11, 2025
3539e9e
docs: Add missing comment
Josmithr Aug 11, 2025
c82ed94
fix: Tests
Josmithr Aug 11, 2025
79490c4
refactor: Use single helper
Josmithr Aug 11, 2025
8d042c4
test: Clean up pre-post operation validation
Josmithr Aug 11, 2025
3911f4d
refactor: Remove unneeded return values
Josmithr Aug 11, 2025
81f0cc9
fix: Leverage shared helper
Josmithr Aug 11, 2025
2acc79c
test: Update pattern
Josmithr Aug 11, 2025
e0ec7b2
refactor: Unify variable naming
Josmithr Aug 11, 2025
80a099b
docs: Add comments
Josmithr Aug 11, 2025
ab6796d
Merge branch 'main' into table-perf-test-updates
Josmithr Aug 11, 2025
82a1169
fix: Dispose undo/redo manager
Josmithr Aug 12, 2025
542b029
WIP
Josmithr Aug 12, 2025
1183dc7
Merge branch 'table-perf-test-updates' into tree/table-insert-methods…
Josmithr Aug 12, 2025
c536733
fix: Tests
Josmithr Aug 12, 2025
6a1eb11
refactor: Remove single insert/remove methods and add range removal m…
Josmithr Aug 12, 2025
31695b2
fix: Index querying
Josmithr Aug 12, 2025
bbc3c61
fix: API and input validation
Josmithr Aug 12, 2025
f3a27bd
test: Add by-ID coverage
Josmithr Aug 12, 2025
44431ab
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 13, 2025
1edd336
docs: Update comments
Josmithr Aug 13, 2025
57bc97d
docs: Update comments
Josmithr Aug 13, 2025
cbe042e
test: Add perf tests for batch row and column insertion
Josmithr Aug 13, 2025
e31e385
docs: Update docs
Josmithr Aug 13, 2025
52cc631
docs: Update API report
Josmithr Aug 13, 2025
78eb83a
docs: Fix comment typo
Josmithr Aug 13, 2025
d960faa
fix: Call correct APIs
Josmithr Aug 13, 2025
814acd3
fix: Handling of ranges in transactions
Josmithr Aug 13, 2025
f349dd2
refactor: Use `count` instead of `end`
Josmithr Aug 13, 2025
c6dac4d
docs: Update API report
Josmithr Aug 13, 2025
37108bf
Merge branch 'tree/table-insert-methods-refactoring' of https://githu…
Josmithr Aug 13, 2025
3edc347
improvement(tree): Update `removeColumn` to remove cells as well
Josmithr Aug 13, 2025
480af16
docs: Update changeset
Josmithr Aug 13, 2025
6c6fd1a
improvement: Use removal API
Josmithr Aug 13, 2025
f5cfdbe
improvement: Use index overloads
Josmithr Aug 13, 2025
f0c1a83
fix: Make index parameter optional
Josmithr Aug 13, 2025
2983ee9
docs: Update API reports
Josmithr Aug 13, 2025
73193a3
docs: Add notes about perf concerns
Josmithr Aug 13, 2025
b1173c4
Merge branch 'main' into tree/table-column-deletion
Josmithr Aug 13, 2025
ffffef2
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 13, 2025
94346c3
Merge branch 'tree/table-column-deletion' into tree/table-insert-meth…
Josmithr Aug 13, 2025
716e643
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 15, 2025
daec8e2
refactor: Better index find pattern
Josmithr Aug 15, 2025
6ca61e2
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 15, 2025
8fae8e4
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 18, 2025
eaa244a
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 19, 2025
e008aa5
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 21, 2025
ada4bd5
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 27, 2025
6b5cf52
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 27, 2025
5d283b3
Merge branch 'main' into tree/table-insert-methods-refactoring
Josmithr Aug 28, 2025
9ea66fb
test: Remove `.only`
Josmithr Aug 28, 2025
e5fe282
docs: Remove stale TODO
Josmithr Aug 28, 2025
b335d8c
test: Remove duplicated tests
Josmithr Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 101 additions & 25 deletions packages/dds/matrix/src/test/memory/sharedMatrix.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ describe("SharedMatrix memory usage", () => {
// Insert-related tests that are not limited by matrixSize
for (const count of operationCounts) {
describe(`Column Insertion`, () => {
// Test the memory usage of the SharedMatrix for inserting a column in the middle for a given number of times.
// Test the memory usage of inserting a single column in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Insert a column in the middle ${count} times`,
Expand All @@ -298,7 +298,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the insertion of a column in the middle for a given number of times.
// Test the memory usage of undoing the insertion of a single column in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo insert column in the middle ${count} times`,
Expand All @@ -313,7 +313,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the insertion of a column in the middle for a given number of times.
// Test the memory usage of redoing the insertion of a single column in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo insert column in the middle ${count} times`,
Expand All @@ -327,10 +327,48 @@ describe("SharedMatrix memory usage", () => {
},
}),
);

// Test the memory usage of inserting a batch of N columns in the middle of the table.
benchmarkMemory(
createBenchmark({
title: `Insert a batch of ${count} columns in the middle of the table`,
matrixSize,
initialCellValue,
operation: (matrix) => {
matrix.insertCols(Math.floor(matrix.colCount / 2), count);
},
}),
);

// Test the memory usage of undoing the insertion of a batch of N columns in the middle of the table.
benchmarkMemory(
createUndoBenchmark({
title: `Undo: insert a batch of ${count} columns in the middle of the table`,
matrixSize,
initialCellValue,
stackCount: 1,
operation: (matrix) => {
matrix.insertCols(Math.floor(matrix.colCount / 2), count);
},
}),
);

// Test the memory usage of redoing the insertion of a batch of N columns in the middle of the table.
benchmarkMemory(
createRedoBenchmark({
title: `Redo: insert a batch of ${count} columns in the middle of the table`,
matrixSize,
initialCellValue,
stackCount: 1,
operation: (matrix) => {
matrix.insertCols(Math.floor(matrix.colCount / 2), count);
},
}),
);
});

describe("Row Insertion", () => {
// Test the memory usage of the SharedMatrix for inserting a row in the middle for a given number of times.
// Test the memory usage of inserting a single empty row in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Insert a row in the middle ${count} times`,
Expand All @@ -344,7 +382,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the insertion of a row in the middle for a given number of times.
// Test the memory usage of undoing the insertion of a single empty row in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo insert row in the middle ${count} times`,
Expand All @@ -359,7 +397,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the insertion of a row in the middle for a given number of times.
// Test the memory usage of redoing the insertion of a single empty row in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo insert row in the middle ${count} times`,
Expand All @@ -373,10 +411,48 @@ describe("SharedMatrix memory usage", () => {
},
}),
);

// Test the memory usage of inserting a batch of N rows in the middle of the table.
benchmarkMemory(
createBenchmark({
title: `Insert a batch of ${count} rows in the middle of the table`,
matrixSize,
initialCellValue,
operation: (matrix) => {
matrix.insertRows(Math.floor(matrix.rowCount / 2), count);
},
}),
);

// Test the memory usage of undoing the insertion of a batch of N rows in the middle of the table.
benchmarkMemory(
createUndoBenchmark({
title: `Undo: insert a batch of ${count} rows in the middle of the table`,
matrixSize,
initialCellValue,
stackCount: 1,
operation: (matrix) => {
matrix.insertRows(Math.floor(matrix.rowCount / 2), count);
},
}),
);

// Test the memory usage of redoing the insertion of a batch of N rows in the middle of the table.
benchmarkMemory(
createRedoBenchmark({
title: `Redo: insert a batch of ${count} rows in the middle of the table`,
matrixSize,
initialCellValue,
stackCount: 1,
operation: (matrix) => {
matrix.insertRows(Math.floor(matrix.rowCount / 2), count);
},
}),
);
});

describe("Row and Column Insertion", () => {
// Test the memory usage of the SharedMatrix for inserting a row and a column in the middle for a given number of times.
// Test the memory usage of inserting a single empty row and a column in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Insert a row and a column ${count} times`,
Expand All @@ -391,7 +467,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the insertion of a row and a column in the middle for a given number of times.
// Test the memory usage of undoing the insertion of a single empty row and a column in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo insert a row and a column ${count} times`,
Expand All @@ -407,7 +483,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the insertion of a row and a column in the middle for a given number of times.
// Test the memory usage of redoing the insertion of a single empty row and a column in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo insert a row and a column ${count} times`,
Expand All @@ -425,12 +501,12 @@ describe("SharedMatrix memory usage", () => {
});

/**
* Test the memory usage of the SharedMatrix for inserting a column and a row
* Test the memory usage of inserting a single column and a row
* and then removing them right away to see if the memory is released.
* Memory usage should be very low for these test cases.
*/
describe("Row and Column Insertion and Removal right away", () => {
// Test the memory usage of the SharedMatrix for inserting a row and a column and then removing them right away for a given number of times.
// Test the memory usage of inserting a single empty row and a column and then removing them right away for a given number of times.
benchmarkMemory(
createBenchmark({
title: `Insert and remove a row and a column ${count} times`,
Expand All @@ -447,7 +523,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the insertion of a row and a column and then removing them right away for a given number of times.
// Test the memory usage of undoing the insertion of a single empty row and a column and then removing them right away for a given number of times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo insert and remove a row and a column ${count} times`,
Expand All @@ -465,7 +541,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the insertion of a row and a column and then removing them right away for a given number of times.
// Test the memory usage of redoing the insertion of a single empty row and a column and then removing them right away for a given number of times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo insert a row and a column ${count} times`,
Expand All @@ -488,7 +564,7 @@ describe("SharedMatrix memory usage", () => {
// Remove-related tests that operation counts are up to matrixSize
for (const count of validRemoveCounts) {
describe("Column Removal", () => {
// Test the memory usage of the SharedMatrix for removing a column in the middle for a given number of times.
// Test the memory usage of removing a column in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Remove the middle column ${count} times`,
Expand All @@ -502,7 +578,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the removal of a column in the middle for a given number of times.
// Test the memory usage of undoing the removal of a column in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo remove the middle column ${count} times`,
Expand All @@ -517,7 +593,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the removal of a column in the middle for a given number of times.
// Test the memory usage of redoing the removal of a column in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo remove the middle column ${count} times`,
Expand All @@ -534,7 +610,7 @@ describe("SharedMatrix memory usage", () => {
});

describe("Row Removal", () => {
// Test the memory usage of the SharedMatrix for removing a row in the middle for a given number of times.
// Test the memory usage of removing a row in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Remove the middle row ${count} times`,
Expand All @@ -548,7 +624,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the removal of a row in the middle for a given number of times.
// Test the memory usage of undoing the removal of a row in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo remove the middle row ${count} times`,
Expand All @@ -563,7 +639,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the removal of a row in the middle for a given number of times.
// Test the memory usage of redoing the removal of a row in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo remove the middle row ${count} times`,
Expand All @@ -580,7 +656,7 @@ describe("SharedMatrix memory usage", () => {
});

describe("Row and Column Removal", () => {
// Test the memory usage of the SharedMatrix for removing a row and a column in the middle for a given number of times.
// Test the memory usage of removing a row and a column in the middle of the table N times.
benchmarkMemory(
createBenchmark({
title: `Remove a row and a column ${count} times`,
Expand All @@ -595,7 +671,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the removal of a row and a column in the middle for a given number of times.
// Test the memory usage of undoing the removal of a row and a column in the middle of the table N times.
benchmarkMemory(
createUndoBenchmark({
title: `Undo remove a row and a column ${count} times`,
Expand All @@ -611,7 +687,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the removal of a row and a column in the middle for a given number of times.
// Test the memory usage of redoing the removal of a row and a column in the middle of the table N times.
benchmarkMemory(
createRedoBenchmark({
title: `Redo remove a row and a column ${count} times`,
Expand All @@ -629,7 +705,7 @@ describe("SharedMatrix memory usage", () => {
});

describe("Cell Value Setting", () => {
// Test the memory usage of the SharedMatrix for setting a 3-character string in a given number of cells.
// Test the memory usage of setting a 3-character string in a given number of cells.
benchmarkMemory(
createBenchmark({
title: `Set a 3-character string in ${count} cells`,
Expand All @@ -643,7 +719,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for undoing the setting of a 3-character string in a given number of cells.
// Test the memory usage of undoing the setting of a 3-character string in a given number of cells.
benchmarkMemory(
createUndoBenchmark({
title: `Undo setting a 3-character string in ${count} cells`,
Expand All @@ -658,7 +734,7 @@ describe("SharedMatrix memory usage", () => {
}),
);

// Test the memory usage of the SharedMatrix for redoing the setting of a 3-character string in a given number of cells.
// Test the memory usage of redoing the setting of a 3-character string in a given number of cells.
benchmarkMemory(
createRedoBenchmark({
title: `Redo setting a 3-character string in ${count} cells`,
Expand Down
Loading
Loading