const cpp_code = ` #include #include #include class [[cheerp::jsexport]] JsBridge { public: JsBridge() = default; size_t test() { volatile size_t counter = 0; for (int i = 0; i < 50000; ++i) { for (int j = 0; j < 50000; ++j) { counter++; } } return sqrt(counter); } }; void webMain() {} `.trim(); const html_code = ` Benchmark started...


Benchmark finished...
`.trim(); const js_code = ``.trim(); const flags = ` -cheerp-pretty-code -cheerp-no-type-optimizer -cheerp-no-native-math -cheerp-no-math-imul -cheerp-no-math-fround -O3 -target cheerp`.trim() const wasm_code = ''; export const example = { title: 'JS vs Compiled JS perf', cpp_code: cpp_code, js_code: js_code, wasm_code: wasm_code, html_code: html_code, flags: flags }