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

     
    reLiteral.test('132abc67219f019afe12901a')
  • RegExp

     
    reSimpleConstructor.test('132abc67219f019afe12901a')
  • Constructor

     
    reConstructor.test('132abc67219f019afe12901a')
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    literal
    RegExp
    Constructor

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Chrome 83 on Mac OS X 10.13.6
View result in a separate tab
Test name Executions per second
literal 6191115.5 Ops/sec
RegExp 5552362.5 Ops/sec
Constructor 5835731.0 Ops/sec