-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45faa0d
commit 4c515c4
Showing
14 changed files
with
14,396 additions
and
274,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as orama_2_1_1 from 'npm:@orama/[email protected]' | ||
import * as orama_3_0_0_rc_2 from 'npm:@orama/[email protected]' | ||
import * as orama_latest from '../packages/orama/dist/deno/index.js' | ||
import dataset from './dataset.json' with { type: 'json' } | ||
|
||
const schema = { | ||
title: 'string', | ||
description: 'string', | ||
rating: 'number', | ||
genres: 'enum[]' | ||
} | ||
|
||
async function getV2_1_1DB() { | ||
const db = await orama_2_1_1.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
await orama_2_1_1.insert(db, doc) | ||
} | ||
|
||
return db | ||
} | ||
|
||
function getV3_0_0_rc_2DB() { | ||
const db = orama_3_0_0_rc_2.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
orama_3_0_0_rc_2.insert(db, doc) | ||
} | ||
|
||
return db | ||
} | ||
|
||
function getLatestDB() { | ||
const db = orama_latest.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
orama_latest.insert(db, doc) | ||
} | ||
|
||
return db | ||
} | ||
|
||
export { | ||
orama_2_1_1, | ||
orama_3_0_0_rc_2, | ||
orama_latest, | ||
schema, | ||
dataset, | ||
getV2_1_1DB, | ||
getV3_0_0_rc_2DB, | ||
getLatestDB | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "@orama/benchmarks" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { orama_2_1_1, orama_3_0_0_rc_2, orama_latest, schema, dataset } from './common.js' | ||
|
||
Deno.bench('v2.1.1 insert', async () => { | ||
const db = await orama_2_1_1.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
await orama_2_1_1.insert(db, doc) | ||
} | ||
}) | ||
|
||
Deno.bench('v3.0.0-rc2 insert', () => { | ||
const db = orama_3_0_0_rc_2.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
orama_3_0_0_rc_2.insert(db, doc) | ||
} | ||
}) | ||
|
||
Deno.bench('latest insert', () => { | ||
const db = orama_latest.create({ schema }) | ||
|
||
for (const doc of dataset) { | ||
orama_latest.insert(db, doc) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { orama_2_1_1, orama_3_0_0_rc_2, orama_latest, getV2_1_1DB, getV3_0_0_rc_2DB, getLatestDB } from './common.js' | ||
|
||
const v2_1_1DB = await getV2_1_1DB() | ||
const v3_0_0_rc_2DB = getV3_0_0_rc_2DB() | ||
const latestDB = getLatestDB() | ||
|
||
Deno.bench('v2.1.1 search (with filters)', async () => { | ||
await orama_2_1_1.search(v2_1_1DB, { | ||
term: 'AI companions', | ||
where: { | ||
rating: { | ||
gte: 3 | ||
}, | ||
genres: { | ||
containsAll: ['RPG'] | ||
} | ||
} | ||
}) | ||
}) | ||
|
||
Deno.bench('v3.0.0-rc2 search (with filters)', () => { | ||
orama_3_0_0_rc_2.search(v3_0_0_rc_2DB, { | ||
term: 'AI companions', | ||
where: { | ||
rating: { | ||
gte: 3 | ||
}, | ||
genres: { | ||
containsAll: ['RPG'] | ||
} | ||
} | ||
}) | ||
}) | ||
|
||
Deno.bench('latest search (with filters)', () => { | ||
orama_latest.search(latestDB, { | ||
term: 'AI companions', | ||
where: { | ||
rating: { | ||
gte: 3 | ||
}, | ||
genres: { | ||
containsAll: ['RPG'] | ||
} | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { orama_2_1_1, orama_3_0_0_rc_2, orama_latest, getV2_1_1DB, getV3_0_0_rc_2DB, getLatestDB } from './common.js' | ||
|
||
const v2_1_1DB = await getV2_1_1DB() | ||
const v3_0_0_rc_2DB = getV3_0_0_rc_2DB() | ||
const latestDB = getLatestDB() | ||
|
||
Deno.bench('v2.1.1 search', async () => { | ||
await orama_2_1_1.search(v2_1_1DB, { | ||
term: 'super mario' | ||
}) | ||
}) | ||
|
||
Deno.bench('v3.0.0-rc2 search', () => { | ||
orama_3_0_0_rc_2.search(v3_0_0_rc_2DB, { | ||
term: 'super mario' | ||
}) | ||
}) | ||
|
||
Deno.bench('latest search', () => { | ||
orama_latest.search(latestDB, { | ||
term: 'super mario' | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.