fromCodePoint vs fromCharCode

Benchmark created on


Setup

var count = 100;

Test runner

Ready to run.

Testing in
TestOps/sec
String.fromCodePoint
// "\uD834\uDF06a\uD834\uDF07"
for (var i = 0; i < count; i++) {
	String.fromCodePoint(0x1d306, 0x61, 0x1d307);
}
ready
String.fromCharCode
// "\uD834\uDF06a\uD834\uDF07"
for (var i = 0; i < count; i++) {
	String.fromCharCode(0xd834, 0xdf06, 0x61, 0xd834, 0xdf07); 
}
ready

Revisions

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