Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit d3c5169

Browse files
committedMay 4, 2023
measure time to create a y-indexeddb instance
1 parent 9181269 commit d3c5169

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎tests/y-indexeddb.tests.js

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ import { IndexeddbPersistence, clearDocument, PREFERRED_TRIM_SIZE, fetchUpdates
44
import * as t from 'lib0/testing.js'
55
import * as promise from 'lib0/promise.js'
66

7+
/**
8+
* @param {t.TestCase} tc
9+
*/
10+
export const testPerf = async tc => {
11+
await t.measureTimeAsync('time to create a y-indexeddb instance', async () => {
12+
const ydoc = new Y.Doc()
13+
const provider = new IndexeddbPersistence(tc.testName, ydoc)
14+
await provider.whenSynced
15+
provider.destroy()
16+
})
17+
}
18+
719
/**
820
* @param {t.TestCase} tc
921
*/

0 commit comments

Comments
 (0)
This repository has been archived.