Skip to content

Commit

Permalink
uncomment query stats
Browse files Browse the repository at this point in the history
  • Loading branch information
sliterok committed Mar 12, 2024
1 parent 5dc09f3 commit 57b2b43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class OPFSDB<T extends IBasicRecord> {
},
options?: IQueryOptions
): Promise<T[] | string[]> {
// const start = performance.now()
const start = performance.now()
let indexes = new Set<string>()
for (const key in queries) {
const tree = this.trees[key]
Expand All @@ -175,12 +175,13 @@ export class OPFSDB<T extends IBasicRecord> {
}
}
const indexArray = Array.from(indexes)
// const indexesFinish = performance.now()
const indexesFinish = performance.now()
if (options?.keys) return indexArray

const records = await this.readMany(indexArray)
// const responsesLoaded = performance.now()
// console.log('indexes:', indexesFinish - start, 'records:', responsesLoaded - indexesFinish)
const responsesLoaded = performance.now()
// eslint-disable-next-line no-console
console.log('indexes:', indexesFinish - start, 'records:', responsesLoaded - indexesFinish)
return records
}

Expand Down

0 comments on commit 57b2b43

Please sign in to comment.