Skip to content

Commit 211acc2

Browse files
committed
Set some pragmas on the SQLite benchmark
1 parent 51791d8 commit 211acc2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/d2ts-benchmark/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ joinSuite.add({
197197
setup: () => {
198198
const sqlite = new Database(':memory:')
199199
const db = new BetterSQLite3Wrapper(sqlite)
200+
201+
// Improve the sqlite performance
202+
db.exec(`PRAGMA journal_mode = WAL;`)
203+
db.exec(`PRAGMA synchronous = OFF;`)
204+
db.exec(`PRAGMA temp_store = MEMORY;`)
205+
db.exec(`PRAGMA cache_size = -100000;`) // 100MB
206+
200207
const graph = new D2({ initialFrontier: v([0]) })
201208
const usersStream = graph.newInput<[number, (typeof allUsers)[0]]>()
202209
const postsStream = graph.newInput<[number, (typeof allPosts)[0]]>()

0 commit comments

Comments
 (0)