mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
29 lines
711 B
TypeScript
29 lines
711 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { lowerCase as lowerCaseToolkit } from 'es-toolkit';
|
|
import { lowerCase as lowerCaseLodash } from 'lodash';
|
|
|
|
describe('lowerCase', () => {
|
|
describe('short string', () => {
|
|
bench('es-toolkit/lowerCase', () => {
|
|
const str = 'camelCase';
|
|
lowerCaseToolkit(str);
|
|
});
|
|
|
|
bench('lodash/lowerCase', () => {
|
|
const str = 'camelCase';
|
|
lowerCaseLodash(str);
|
|
});
|
|
});
|
|
|
|
describe('long string', () => {
|
|
const LONG_STR = 'camelCaseLongString'.repeat(1000);
|
|
bench('es-toolkit/lowerCase', () => {
|
|
lowerCaseToolkit(LONG_STR);
|
|
});
|
|
|
|
bench('lodash/lowerCase', () => {
|
|
lowerCaseLodash(LONG_STR);
|
|
});
|
|
});
|
|
});
|