Digit Regexp vs Bitwise String Coerceon

Benchmark created by XFox Prower on


Setup

var X='1234567';

Test runner

Ready to run.

Testing in
TestOps/sec
Digit Regexp
X.match(/^\d{7}$/);
ready
Bitwise String Coerceon
((~~X)+'').length;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by XFox Prower on