Always new instance vs static global instance vs Lodash cache vs Custom cache with maps vs Custom cache with objectsFastest: static global instance (36.7x faster)
2,528,241 ops/sec
2,455,811 ops/sec
1,727,712 ops/sec
1,149,347 ops/sec
68,960 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Always new instance | |
| static global instance | |
| Lodash cache | |
| Custom cache with maps | |
| Custom cache with objects |
| Test name | Executions per second |
|---|---|
| ✓ Custom cache with maps | 1,681,500 Ops/sec |
| static global instance | 1,584,848 Ops/sec |
| Custom cache with objects | 1,484,761 Ops/sec |
| Lodash cache | 1,044,699 Ops/sec |
| Always new instance | 28,432 Ops/sec |