Script Preparation code:
AخA
 
var reConstructor = new RegExp('^[0-9a-fA-F]{24}$')
var reLiteral = /^[0-9a-fA-F]{24}$/
Tests:
  • new RegExp()

     
    reConstructor.test('132abc67219f019afe12901a')
  • Literal

     
    reLiteral.test('132abc67219f019afe12901a')
  • Inline literal

     
    /^[0-9a-fA-F]{24}$/.test('132abc67219f019afe12901a')
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    new RegExp()
    Literal
    Inline literal

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138 on Windows
View result in a separate tab
Test name Executions per second
new RegExp() 3444816.0 Ops/sec
Literal 3384302.8 Ops/sec
Inline literal 3473715.2 Ops/sec