mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
30 lines
685 B
TypeScript
30 lines
685 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { last as lastToolkit } from 'es-toolkit';
|
|
import { last as lastLodash } from 'lodash';
|
|
|
|
describe('last', () => {
|
|
bench('es-toolkit/last', () => {
|
|
const people = [
|
|
{ name: 'mike', age: 20 },
|
|
{ name: 'jake', age: 30 },
|
|
{ name: 'john', age: 25 },
|
|
{ name: 'sarah', age: 25 },
|
|
{ name: 'emma', age: 25 },
|
|
];
|
|
|
|
lastToolkit(people);
|
|
});
|
|
|
|
bench('lodash/last', () => {
|
|
const people = [
|
|
{ name: 'mike', age: 20 },
|
|
{ name: 'jake', age: 30 },
|
|
{ name: 'john', age: 25 },
|
|
{ name: 'sarah', age: 25 },
|
|
{ name: 'emma', age: 25 },
|
|
];
|
|
|
|
lastLodash(people);
|
|
});
|
|
});
|