Skip to content

Commit

Permalink
fix bench hydrating the same recs world
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Feb 27, 2024
1 parent c463c84 commit 6ddd68b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions packages/store-sync/benchmarks/storageAdapter.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ describe.each([

bench("recs: `storageAdapter`", async () => {
const { storageAdapter } = createRecsStorage();

for (const block of blocks) {
await storageAdapter(block);
}
});

bench("zustand: `storageAdapter`", async () => {
const { storageAdapter } = createZustandStorage();

for (const block of blocks) {
await storageAdapter(block);
}
});

bench("sqlite: `storageAdapter`", async () => {
const { storageAdapter } = await createSqliteStorage();

for (const block of blocks) {
await storageAdapter(block);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ import worldRpcLogs from "../../../test-data/world-logs.json";

const blocks = logsToBlocks(worldRpcLogs);

const { storageAdapter: recsStorageAdapter } = createRecsStorage();
const { storageAdapter: zustandStorageAdapter } = createZustandStorage();
const { storageAdapter: sqliteStorageAdapter } = await createSqliteStorage();

describe("Hydrate Storage Adapter: singleton", () => {
bench("recs: `storageAdapter`", async () => {
const { storageAdapter: recsStorageAdapter } = createRecsStorage();
for (const block of blocks) {
await recsStorageAdapter(block);
}
});

bench("zustand: `storageAdapter`", async () => {
const { storageAdapter: zustandStorageAdapter } = createZustandStorage();
for (const block of blocks) {
await zustandStorageAdapter(block);
}
});

bench("sqlite: `storageAdapter`", async () => {
const { storageAdapter: sqliteStorageAdapter } = await createSqliteStorage();
for (const block of blocks) {
await sqliteStorageAdapter(block);
}
Expand Down

0 comments on commit 6ddd68b

Please sign in to comment.