From 4148e1cd2d6afab6642ccec8d394170337632a5f Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 13 Feb 2025 23:43:04 -0800 Subject: [PATCH] Add 50MB benchmarks --- benchmark/core.bench.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/benchmark/core.bench.js b/benchmark/core.bench.js index 953fdc3..b7b4340 100644 --- a/benchmark/core.bench.js +++ b/benchmark/core.bench.js @@ -24,6 +24,20 @@ await benchmarkIterations('Transform 1MB'.padEnd(NAME_LENGTH, '.'), 20, async () for await (const _ of r) { } }); +await benchmark('Write 50MB'.padEnd(NAME_LENGTH, '.'), async () => { + await createRandomCSV(50000, 100, iter++).pipeTo(new CSVWriter(temp)); +}); + +await benchmark('Read 50MB'.padEnd(NAME_LENGTH, '.'), async () => { + const r = new CSVReader(temp); + for await (const _ of r) { } +}); + +await benchmark('Transform 50MB'.padEnd(NAME_LENGTH, '.'), async () => { + const r = createRandomCSV(50000, 100, iter++).pipeThrough(new CSVTransformer(r => r.map(f => Number(f) + 1))); + for await (const _ of r) { } +}); + await benchmark('Write 100MB'.padEnd(NAME_LENGTH, '.'), async () => { await createRandomCSV(100000, 100, iter++).pipeTo(new CSVWriter(temp)); }); -- 2.47.3