From c8b2ce9fb0d1bfb82499eadc2658b0de5cbf379a Mon Sep 17 00:00:00 2001 From: kamiazya Date: Sun, 15 Sep 2024 01:20:45 +0900 Subject: [PATCH] Fix benchmark test names for parsing CSV strings --- packages/parser/src/lib/parseString.bench.ts | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/parser/src/lib/parseString.bench.ts b/packages/parser/src/lib/parseString.bench.ts index 97e6034..aa65d60 100644 --- a/packages/parser/src/lib/parseString.bench.ts +++ b/packages/parser/src/lib/parseString.bench.ts @@ -7,27 +7,30 @@ import { parseString } from "./parseString.js"; describe.each([50, 100, 500, 1_000])("%d row", (row) => { const string = getStringCSV(row); - bench(`parse a string ${row} CSV to an AsyncIterableIterator`, async () => { - for await (const _ of parseString(string)) { - // noop - } - }); - - bench(`parse a string ${row} CSV to an Array`, () => { + bench( + `parse a string ${row} row CSV to an AsyncIterableIterator`, + async () => { + for await (const _ of parseString(string)) { + // noop + } + }, + ); + + bench(`parse a string ${row} row CSV to an Array`, () => { parseString.toArraySync(string); }); - bench(`parse a string ${row} CSV to a Promise`, async () => { + bench(`parse a string ${row} row CSV to a Promise`, async () => { await parseString.toArray(string); }); - bench(`parse a string ${row} CSV to a IterableIterator`, () => { + bench(`parse a string ${row} row CSV to a IterableIterator`, () => { for (const _ of parseString.toIterableIterator(string)) { // noop } }); - bench(`parse a string ${row} CSV to a ReadableStream`, async () => { + bench(`parse a string ${row} row CSV to a ReadableStream`, async () => { await parseString.toStream(string).pipeTo( new WritableStream({ write(_) {