String interning (v6)

Revision 6 of this benchmark created on


Description

Check string interning capability

Setup

var str1 = concatenate(["as", "tr", "ing"]);
var str2 = concatenate(["ast", "ring"]);
var str3 = concatenate(["as", "tr", "N"]);

function concatenate(strings) {
	let result = '';
	for (const str of strings)
		result = result + str;

	return new String(result);
}

Test runner

Ready to run.

Testing in
TestOps/sec
equals
str1 === str2
ready
startsWith
str1.startsWith(str2)
ready
not equals
str1 === str3
ready
startsWith [not equals]
str1.startsWith(str3)
ready

Revisions

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

  • Revision 1: published by Norman P. on
  • Revision 4: published by Sandro Hawke on
  • Revision 5: published by Sandro Hawke on
  • Revision 6: published on