Script Preparation code:
AخA
 
var min = 0;
var MAX_CID_VALUE = 268435455;
var cid = 200000;
var result = null;
Tests:
  • regexp

     
    result = /^[0-9]{1,9}$/.test(cid) && Number(cid) < MAX_CID_VALUE
  • func

    x
     
    const val = Number.parseInt(cid);
    result = isNaN(val) || val >  MAX_CID_VALUE || val < 0;
      
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    regexp
    func

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Windows
View result in a separate tab
Test name Executions per second
regexp 2509406.2 Ops/sec
func 2489991.5 Ops/sec