Javascript Set intersection vs Lodash intersection vs Javascript Array intersectionFastest: Lodash intersection (2.2x faster)
461,848 ops/sec
381,851 ops/sec
211,508 ops/sec
Fastest: Javascript Array intersection (1.5x faster)
428,474 ops/sec
380,733 ops/sec
284,397 ops/sec
Fastest: Lodash intersection (1.9x faster)
418,885 ops/sec
248,688 ops/sec
223,875 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Javascript Set intersection | |
| Lodash intersection | |
| Javascript Array intersection |
| Test name | Executions per second |
|---|---|
| ✓ Javascript Array intersection | 579,884 Ops/sec |
| Lodash intersection | 578,464 Ops/sec |
| Javascript Set intersection | 503,256 Ops/sec |