mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-03 13:53:50 +03:00
3cc1a03519
* chore: add codspeed * chore: fix the benchmark file to clearly distinguish between the comparison targets * chore: fix typo
24 lines
610 B
TypeScript
24 lines
610 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { minBy as minByToolkit } from 'es-toolkit';
|
|
import { minBy as minByLodash } from 'lodash';
|
|
|
|
describe('minBy', () => {
|
|
bench('es-toolkit/minBy', () => {
|
|
const people = [
|
|
{ name: 'Mark', age: 30 },
|
|
{ name: 'Nunu', age: 20 },
|
|
{ name: 'Overmars', age: 35 },
|
|
];
|
|
minByToolkit(people, person => person.age);
|
|
});
|
|
|
|
bench('lodash/minBy', () => {
|
|
const people = [
|
|
{ name: 'Mark', age: 30 },
|
|
{ name: 'Nunu', age: 20 },
|
|
{ name: 'Overmars', age: 35 },
|
|
];
|
|
minByLodash(people, person => person.age);
|
|
});
|
|
});
|