-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bench mark를 실행할 수 있도록 환경을 세팅합니다 (#261)
* bench mark를 실행할 수 있도록 환경을 세팅합니다 * bench mark를 실행할 수 있도록 환경을 세팅합니다 * ignore bench lint * bench mark 에제를 더 추가합니다 * revert josa
- Loading branch information
Showing
8 changed files
with
763 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "benchmarks", | ||
"private": true, | ||
"scripts": { | ||
"check-bundle-size": "vitest --update" | ||
}, | ||
"dependencies": { | ||
"@faker-js/faker": "^9.1.0", | ||
"auto-josa": "^1.0.0", | ||
"es-hangul": "workspace:^", | ||
"esbuild": "0.23.0", | ||
"josa": "^3.0.1", | ||
"k-popo": "^2.0.5", | ||
"vitest": "^2.1.2" | ||
}, | ||
"devDependencies": { | ||
"@types/josa": "^3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { fakerKO as faker } from '@faker-js/faker'; | ||
|
||
import { josa as autoJosa } from 'auto-josa'; | ||
import { josa as esHangulJosa } from 'es-hangul'; | ||
import { josa } from 'josa'; | ||
import { ko } from 'k-popo'; | ||
import { bench, describe } from 'vitest'; | ||
|
||
const name = faker.person.firstName(); | ||
|
||
describe('하나의 조사', () => { | ||
bench('es-hangul', () => { | ||
esHangulJosa(name, '이/가'); | ||
}); | ||
|
||
bench('auto-josa', () => { | ||
autoJosa`${name}이`; | ||
}); | ||
|
||
bench('josa', () => { | ||
josa(`${name}#{이}`); | ||
}); | ||
|
||
bench('k-popo', () => { | ||
ko`${name}(이)가`; | ||
}); | ||
}); | ||
|
||
const city = faker.location.city(); | ||
const street = faker.location.street(); | ||
const noun = faker.word.noun(); | ||
|
||
describe(`네개의 조사 ${name}이/가 ${noun}을/를 ${city}은/는 ${street}와/과`, () => { | ||
bench('es-hangul', () => { | ||
esHangulJosa(noun, '이/가'); | ||
esHangulJosa(name, '을/를'); | ||
esHangulJosa(city, '은/는'); | ||
esHangulJosa(street, '와/과'); | ||
}); | ||
|
||
bench('auto-josa', () => { | ||
autoJosa`${noun}이`; | ||
autoJosa`${name}을`; | ||
autoJosa`${city}은`; | ||
autoJosa`${street}와`; | ||
}); | ||
|
||
bench('josa', () => { | ||
josa(`${noun}#{이}`); | ||
josa(`${name}#{을}`); | ||
josa(`${city}#{은}`); | ||
josa(`${street}#{와}`); | ||
}); | ||
|
||
bench('k-popo', () => { | ||
ko`${noun}(이)가`; | ||
ko`${name}(을)를`; | ||
ko`${city}(은)는`; | ||
ko`${street}(와)과`; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.