Script Preparation code:
AخA
 
var str = 'really rare  [TL_HIDDEN] (Phone number hidden by company) (Email hidden by company) [EMAIL_HIDDEN]';
Tests:
  • Split and regex replace

     
    str.split('(Phone number hidden by company)')
    .join('')
    .split('(Email hidden by company)')
    .join('').replace(/(\[TL_HIDDEN\])|(\[EMAIL_HIDDEN\])/g, "");
  • Multiple Split and Join

     
    str.split('(Phone number hidden by company)')
    .join('')
    .split('(Email hidden by company)')
    .join('')
    .split('[TL_HIDDEN]')
    .join('')
    .split('[EMAIL_HIDDEN]')
    .join('');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Split and regex replace
    Multiple Split and Join

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93 on Windows
View result in a separate tab
Test name Executions per second
Split and regex replace 981866.1 Ops/sec
Multiple Split and Join 711681.4 Ops/sec