Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(store-sync): fix bench hydrating the same recs world #2320

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading