From 1ffc1fc8f40cc81e4ae9f1943bbb948771b5c0d1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 25 May 2024 10:49:09 -0500 Subject: [PATCH] hydrate.bench: move the `events` variable above the bench --- src/storages/hydrate.bench.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/storages/hydrate.bench.ts b/src/storages/hydrate.bench.ts index 0ba49973..eeacec50 100644 --- a/src/storages/hydrate.bench.ts +++ b/src/storages/hydrate.bench.ts @@ -4,12 +4,10 @@ import { jsonlEvents } from '@/test.ts'; const testEvents = await jsonlEvents('fixtures/hydrated.jsonl'); const testStats = JSON.parse(await Deno.readTextFile('fixtures/stats.json')); -Deno.bench('assembleEvents with home feed', (b) => { - // The first 20 events in this file are my home feed. - // The rest are events that would be hydrated by the store. - const events = testEvents.slice(0, 20); - - b.start(); +// The first 20 events in this file are my home feed. +// The rest are events that would be hydrated by the store. +const events = testEvents.slice(0, 20); +Deno.bench('assembleEvents with home feed', () => { assembleEvents(events, testEvents, testStats); });