Count words. regexp vs split

4 months ago
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Test name Executions per second
regexp 5905.7 Ops/sec
split 2300674.0 Ops/sec
Script Preparation code:
Tests:
  • regexp

  • split

Open this result on MeasureThat.net