Skip to content

Commit 6f7b4df

Browse files
committed
chore: remove performance measurement logs
1 parent 53bf75d commit 6f7b4df

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

src/runtime/app.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Collections, PageCollections, CollectionQueryBuilder, SurroundOptions, SQLOperator, QueryGroupFunction } from '@nuxt/content'
22
import { collectionQueryBuilder } from './internal/query'
3-
import { measurePerformance } from './internal/performance'
43
import { generateNavigationTree } from './internal/navigation'
54
import { generateItemSurround } from './internal/surround'
65
import { generateSearchSections } from './internal/search'
@@ -40,16 +39,10 @@ async function executeContentQuery<T extends keyof Collections, Result = Collect
4039
}
4140

4241
async function queryContentSqlClientWasm<T extends keyof Collections, Result = Collections[T]>(collection: T, sql: string) {
43-
const perf = measurePerformance()
44-
4542
const rows = await import('./internal/database.client')
4643
.then(m => m.loadDatabaseAdapter(collection))
4744
.then(db => db.all<Result>(sql))
4845

49-
perf.tick('Execute Query')
50-
51-
console.log(perf.end('Run with Compressed Dump'))
52-
5346
return rows as Result[]
5447
}
5548

src/runtime/internal/database.client.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Database } from '@sqlite.org/sqlite-wasm'
22
import type { DatabaseAdapter, DatabaseBindParams } from '@nuxt/content'
3-
import { measurePerformance } from './performance'
43
import { decompressSQLDump } from './dump'
54
import { parseJsonFields } from './collection'
65
import { fetchDatabase } from './api'
@@ -36,12 +35,9 @@ export function loadDatabaseAdapter<T>(collection: T): DatabaseAdapter {
3635
}
3736

3837
async function loadAdapter<T>(collection: T) {
39-
const perf = measurePerformance()
4038
if (!db) {
4139
const sqlite3InitModule = await import('@sqlite.org/sqlite-wasm').then(m => m.default)
4240
const sqlite3 = await sqlite3InitModule()
43-
perf.tick('Import SQLite Module')
44-
4541
db = new sqlite3.oo1.DB()
4642
}
4743

@@ -75,10 +71,8 @@ async function loadAdapter<T>(collection: T) {
7571
}
7672
}
7773

78-
perf.tick('Get Local Cache')
7974
if (!compressedDump) {
8075
compressedDump = await fetchDatabase(undefined, String(collection))
81-
perf.tick('Download Database')
8276
if (!import.meta.dev) {
8377
try {
8478
window.localStorage.setItem(`content_${checksumId}`, checksums[String(collection)])
@@ -87,12 +81,10 @@ async function loadAdapter<T>(collection: T) {
8781
catch (error) {
8882
console.error('Database integrity check failed, rebuilding database', error)
8983
}
90-
perf.tick('Store Database')
9184
}
9285
}
9386

9487
const dump = await decompressSQLDump(compressedDump!)
95-
perf.tick('Decompress Database')
9688

9789
await db.exec({ sql: `DROP TABLE IF EXISTS ${tables[String(collection)]}` })
9890
if (checksumState === 'mismatch') {
@@ -107,10 +99,7 @@ async function loadAdapter<T>(collection: T) {
10799
console.error('Error executing command', error)
108100
}
109101
}
110-
perf.tick('Restore Dump')
111102
}
112103

113-
perf.end('Database Loaded')
114-
115104
return db
116105
}

src/runtime/internal/performance.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)