improve memory allocation ⇒ less "minor gc" cleanups

This commit is contained in:
Kevin Jahns
2020-06-02 23:20:45 +02:00
parent 13da804b5e
commit 60fab42b3f
17 changed files with 149 additions and 138 deletions

View File

@@ -330,6 +330,7 @@ export const compareStructStores = (ss1, ss2) => {
s1.constructor !== s2.constructor ||
!Y.compareIDs(s1.id, s2.id) ||
s1.deleted !== s2.deleted ||
// @ts-ignore
s1.length !== s2.length
) {
t.fail('Structs dont match')

View File

@@ -205,6 +205,23 @@ export const testFormattingRemovedInMidText = tc => {
t.assert(Y.getTypeChildren(text0).length === 3)
}
/**
* @param {t.TestCase} tc
*
export const testLargeFragmentedDocument = tc => {
const { text0, text1, testConnector } = init(tc, { users: 2 })
// @ts-ignore
text0.doc.transact(() => {
for (let i = 0; i < 1000000; i++) {
text0.insert(0, '0')
}
})
t.measureTime('time to apply', () => {
testConnector.flushAllMessages()
})
}
*/
// RANDOM TESTS
let charCounter = 0