Script Preparation code:
AخA
 
var str = 'https://www.testsite.com/some-path/another-path/2019/my-amazing-page-name.html';
Tests:
  • Regex

     
    str.replace(/^(.*[\\\/])/, '');
  • Split

     
    str.split('/').pop();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Regex
    Split

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Linux
View result in a separate tab
Test name Executions per second
Regex 2417840.0 Ops/sec
Split 7390167.5 Ops/sec