Skip to content

Commit

Permalink
update benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ShravanSunder committed Jun 4, 2023
1 parent 6b794d7 commit 119b40c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bench/HierarchicalNSW.3.bench.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ async function setupBefore() {
const testVectorData = createVectorData(baseIndexSize, hnswParamsForAda.dimensions);
index = new testHnswlibModule.HierarchicalNSW('l2', hnswParamsForAda.dimensions);
index.initIndex(baseIndexSize, hnswParamsForAda.m, hnswParamsForAda.efConstruction, 200, true);
await sleep(10);
await sleep(25);

// Add vectors in chunks of 1000
const chunkSize = 2500;
const chunkSize = 2000;
for (let i = 0; i < baseIndexSize; i += chunkSize) {
console.log('chunk', i);
const chunkVectors = testVectorData.vectors.slice(i, i + chunkSize);
index.addItems(chunkVectors, false);
await sleep(10);
await sleep(25);
}

return { baseIndexSize, testVectorData };
}

const { baseIndexSize, testVectorData } = await setupBefore();

describe('benchmark searchKnn with thousand points and default params', async () => {
describe('benchmark searchKnn with thousand points and default params', () => {
beforeAll(async () => {
expect(index.getCurrentCount()).toBe(baseIndexSize);
});
Expand Down

0 comments on commit 119b40c

Please sign in to comment.