]> git.ardis.lu - csvio/commitdiff
Add 50MB benchmarks
authorArdis Lu <ardisglu@gmail.com>
Fri, 14 Feb 2025 07:43:04 +0000 (23:43 -0800)
committerArdis Lu <ardisglu@gmail.com>
Fri, 14 Feb 2025 07:43:04 +0000 (23:43 -0800)
benchmark/core.bench.js

index 953fdc3060c379dd889245fe2c64cbe81a60ccb6..b7b434078d1d299a1f3820878ea6e0594c9be902 100644 (file)
@@ -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));
 });
This page took 0.041302 seconds and 4 git commands to generate.