Test name | Executions per second |
---|---|
String.split | 4785909.5 Ops/sec |
Regex.match | 365508.0 Ops/sec |
Deconstruction | 416354.1 Ops/sec |
string = 'This is a benchmark to test if matching a regex is faster that splitting a string';
regex = /./gi;
const result = string.split('');
const result = string.match(regex);
const result = [string];