Tests:
-
Regex and Loop
-
For loop, ParseInt
-
For loop with switch case
-
For loop, toString
-
Pure Regex
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
9 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
Chrome 138 on Linux
View result in a separate tab
For loop, ParseInt
23.5M/s
For loop with switch case
21.1M/s
For loop, toString
20.3M/s
View exact numbers
| Test name |
Executions per second |
|
✓
For loop, ParseInt
|
23,508,676 Ops/sec |
|
For loop with switch case
|
21,054,052 Ops/sec |
|
For loop, toString
|
20,301,546 Ops/sec |
|
Pure Regex
|
18,711,142 Ops/sec |
|
Regex and Loop
|
1,291,132 Ops/sec |
Do you really want to delete benchmark?