HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Script Preparation code:
x
 
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>

Previous results

Experimental features:

  • 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: 10 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136 on Windows
View result in a separate tab
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