Which is faster, splitting a string into pieces and searching for something specific at the start of each section, or just searching for the splitter and what comes after
Comparing performance of: split some vs indexOf vs includes
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
split some
indexOf
includes
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
2 years ago)
Mozilla/5.0 (Linux; Android 10; RMX1911) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 Mobile Safari/537.36