Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
raon0211 committed Dec 7, 2024
1 parent 8e496f4 commit 18b48f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions benchmarks/performance/reverse.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { bench, describe } from 'vitest';
import { reverse as reverseCompat_ } from 'es-toolkit/compat';
import { reverse as reverseLodash_ } from 'lodash';

const reverseCompat = reverseCompat_;
const reverseLodash = reverseLodash_;

const testArray = Array.from({ length: 1000 }, (_, i) => i);

describe('Reverse function performance tests', () => {
bench('es-toolkit compat reverse', () => {
const arrayCopy = [...testArray];
reverseCompat_(arrayCopy);
reverseCompat(arrayCopy);
});

bench('lodash reverse', () => {
const arrayCopy = [...testArray];
reverseLodash_(arrayCopy);
reverseLodash(arrayCopy);
});
});

0 comments on commit 18b48f3

Please sign in to comment.