Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
UTF-8 vs UTF-16 WASM String Interface
(version: 1)
Comparing performance of:
str_en vs str_ar vs str_en_large vs str_ar_large
Created:
one year ago
by:
Registered User
Jump to the latest result
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);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
str_en
str_ar
str_en_large
str_ar_large
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser/OS:
Firefox 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
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
Related benchmarks:
UTF-8 byte length Arabic 4-mthods
indexOf vs Set to find unique characters
Клавиатура
array replace string
Encode byte string test (string concatenation vs. map join)
flatmap and reduce test_2
ggrt1435werert
TextDecoder vs String.fromCharCode Big
deburr manually vs deburr from lodash
Comments
Confirm delete:
Do you really want to delete benchmark?