성능
es-toolkit은 설계할 때 성능을 우선적으로 고려하고 있어요. lodash와 같은 다른 라이브러리와 비교했을 때, 평균적으로 2배의 성능 향상을 확인할 수 있었어요. 함수에 따라서는 11배 빠른 성능을 보이기도 했죠. 현대적인 JavaScript API을 이용하여 구현했기 때문이에요.
성능 비교
테스트 환경
CPU:Apple M4 10 코어
메모리:16.00 GB
Node.js:v22.23.2
플랫폼:darwin arm64
| es-toolkit@1.52.0 | lodash@4.18.1 | Difference | |
|---|---|---|---|
| omit | 3,973,624 times | 1,306,896 times | 3.0× |
| pick | 9,038,224 times | 2,220,822 times | 4.1× |
| differenceWith | 12,169,353 times | 4,009,328 times | 3.0× |
| difference | 9,097,445 times | 5,122,555 times | 1.8× |
| intersectionWith | 11,220,380 times | 3,022,015 times | 3.7× |
| intersection | 8,431,475 times | 4,348,418 times | 1.9× |
| unionBy | 4,422,940 times | 3,558,872 times | 1.2× |
| union | 4,092,678 times | 4,331,186 times | 0.9× |
| dropRightWhile | 12,852,312 times | 8,392,579 times | 1.5× |
| groupBy | 4,540,652 times | 3,557,114 times | 1.3× |
벤치마크 코드를 참고하세요

