You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Rewrite key portions of the code in WASM to get better performance #17143
I will keep bringing in WebAssembly ("wasm") versions of key portions of code where it is found to be beneficial. In this release, a wasm version of the algorithm used to lookup a hostname from a set of hostnames has been created (related benchmark page).
However, only the Firefox version of uBO benefits from this at this point, as it's is not possible to use wasm in the Chromium version without adding 'unsafe-eval' to the extension's own Content Security Policy in its manifest -- which is not something I am willing to do (my view is that any extension using 'unsafe-eval' should be assumed malicious by default). It works in Firefox because the wasm module is loaded using a same-origin fetch, meaning the module can only be loaded from uBO's own package, which is probably what Chromium ought to implement.
I'm unsure when this will be re-enabled, but until then we can't include it in Tor Browser builds of HTTPS Everywhere. We may be able to have divergent compilations and just enable code paths dependent on what browser we're building for, though. But this will introduce an increased maintenance overhead.
Reacted by Alexis , Kagami Sascha Rosylight, J0WI, anpandey and Alexander Ivanov
This may be relevant to @gorhill as well, in case he knows of anyone using uBlock Origin within Tor Browser. This is probably uncommon but not unheard of.
Latest uBO works with Tor browser. In uBO there is always a JS implementation available should the WASM version fail to load for whatever reason -- this way I don't need two versions of the extension. The WASM version of key portion of code is nice to have but does not make the JS implementation obsolete performance-wise. See arkenfox/user.js#599 (comment).
Reacted by CHAN, Chak Shing, Alexis , Giltyhub and Marc Ranolfi
Thanks @gorhill, that's helpful. This seems a likely path forward for us as well, using a JS implementation as a backup. Still an increased maintenance overhead, but at least not divergent code generated based on build.
Activity
Hainish commentedon Dec 13, 2018
One of the considerations here is that WASM was disabled in Tor Browser: https://trac.torproject.org/projects/tor/ticket/21549
I'm unsure when this will be re-enabled, but until then we can't include it in Tor Browser builds of HTTPS Everywhere. We may be able to have divergent compilations and just enable code paths dependent on what browser we're building for, though. But this will introduce an increased maintenance overhead.
Hainish commentedon Dec 17, 2018
This may be relevant to @gorhill as well, in case he knows of anyone using uBlock Origin within Tor Browser. This is probably uncommon but not unheard of.
gorhill commentedon Dec 17, 2018
Latest uBO works with Tor browser. In uBO there is always a JS implementation available should the WASM version fail to load for whatever reason -- this way I don't need two versions of the extension. The WASM version of key portion of code is nice to have but does not make the JS implementation obsolete performance-wise. See arkenfox/user.js#599 (comment).
Hainish commentedon Dec 17, 2018
Thanks @gorhill, that's helpful. This seems a likely path forward for us as well, using a JS implementation as a backup. Still an increased maintenance overhead, but at least not divergent code generated based on build.
Hainish commentedon Jun 14, 2019
Update: #18093 includes a submodule
https-everywhere-libwhich replaces much of therules.jslogic with WASM.