TextEncoder vs charCodeAt split

Benchmark created on


Setup

var str = "hello encoding";

Test runner

Ready to run.

Testing in
TestOps/sec
TextEncoder
new TextEncoder().encode(str)
ready
manual map
new Uint8Array(str.split("").map((char) => char.charCodeAt(0)))
ready

Revisions

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