Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
UTF-8 vs UTF-16 WASM String Interface
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser:
Firefox 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
str_en
6557358.5 Ops/sec
str_ar
2509458.5 Ops/sec
str_en_large
1376575.0 Ops/sec
str_ar_large
516037.7 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const str_en = "Comparing the performance of UTF-8 vs UTF-16 string encoding copying into and out of WASM. 🙂"; const str_ar = "استعار جحا مرة آنية من جاره وعندما أعادها له أعاد معها آنية صغيرة"; const str_en_large = str_en.repeat(10); const str_ar_large = str_ar.repeat(10); const encoder = new TextEncoder('utf-8'); const decoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
Tests:
str_en
const buf = encoder.encode(str_en); const str = decoder.decode(buf);
str_ar
const buf = encoder.encode(str_ar); const str = decoder.decode(buf);
str_en_large
const buf = encoder.encode(str_en_large); const str = decoder.decode(buf);
str_ar_large
const buf = encoder.encode(str_ar_large); const str = decoder.decode(buf);