Random string generation test

Benchmark created by Hawkeyeaz1 on


Setup

var str = "", array = new Uint8Array(200), lu = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' ];

Test runner

Ready to run.

Testing in
TestOps/sec
str += Number...
for(i = 0; i < 100; i++) str += Number(Math.random() * 16).toString(16);
ready
lookup and Uint8Array
for(i = 0; i < 100; i++) array[i] = lu[Math.random() * 16]
str = String.fromCharCode.apply(null, array);
ready
string + lookup
for(i = 0; i < 100; i++) str += lu[Math.random() * 16];
ready

Revisions

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

  • Revision 1: published by Hawkeyeaz1 on