es-toolkit/benchmarks/zipWith.bench.ts
Jun 3cc1a03519
chore(*): Add codspeed for benchmark visualization (#75)
* chore: add codspeed

* chore: fix the benchmark file to clearly distinguish between the comparison targets

* chore: fix typo
2024-06-18 10:40:07 +09:00

20 lines
550 B
TypeScript

import { bench, describe } from 'vitest';
import { zipWith as zipWithToolkit } from 'es-toolkit';
import { zipWith as zipWithLodash } from 'lodash';
describe('zipWith', () => {
bench('es-toolkit/zipWith', () => {
const arr1 = [1, 2];
const arr2 = [3, 4];
const arr3 = [5, 6];
zipWithToolkit(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);
});
bench('lodash/zipWith', () => {
const arr1 = [1, 2];
const arr2 = [3, 4];
const arr3 = [5, 6];
zipWithLodash(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);
});
});