Disabling Desktop Brower Javscript JIT: Please Experiment!

In the land of “Other weird experiments I’ve been playing with,” it’s possible to disable Javascript JIT in (most) modern desktop browsers. Still not sure about Safari.

Why would you want to do this? Microsoft makes a pretty good case for it here:

And, yes, disabling Javascript JIT hurts performance a lot. Lockdown mode on iOS does this for some serious performance hit, and it shows in Javascript benchmarks that you’re slaughtering performance… in Javascript benchmarks.

But I’ve been using it for a while and I don’t notice that most of the web is significantly slower. I can notice some performance hits, but I use slow machines to start with - my gutless wonder ARM boxes and such.

If you want to try it, with Firefox, go into about:config and change the following to false:

javascript.options.baselinejit
javascript.options.wasm_baselinejit
javascript.options.wasm_optimizingjit 
javascript.options.ion

Chromium based browsers seem to require the command line flag --js-flags="--jitless" - though there may be a flag as well. I don’t have one handy.

And I’ve no idea how to do it on desktop Safari, though on mobile iOS 16 Safari, Lockdown Mode disables jit.

Would people be willing to try this for a couple days in “general use,” and report back? I’m thinking of doing a blag post on the matter, and I’d prefer a few more regular users than me with the impressions of it.

Slightly of topic: I’ve been using lockdown mode on mobile for nearly a month. I’ve not done a side by side comparison to verify some of these aren’t just broken websites, but so far I’ve noticed:
Missing icons (reduced font support)
An article endlessly repeating the last couple sections on one of the tech [sites]
Navigation menus not going where they should
Text moving around on me when scrolling

The first is the only one [I’m] certain is a lockdown artifact. The last two I see sometimes because websites are broken, but I’ve noticed it more lately.

None felt like performance being slow. None convinced me to disable lockdown.

I’ve been using it for a while too, and… yeah, that’s about right.

This is definitely a side effect of Lockdown.

If it was some Ars articles recently, comment threads indicated that it was broken for everyone on mobile.

I would be inclined to put some of that up to the reduced font support - someone made the website pixel perfect with their fonts, and it breaks a bit with the standard ones, but I’m not sure anymore…

You can disable Lockdown on a per-site basis if you want to experiment - it’s in the settings for the website menu to the left of the URL.

Ars sounds right, but I don’t recall for certain. Interesting to know others were seeing it.

About Lockdown Mode - Apple Support says Lockdown Mode works on macOS Ventura, but I don’t know how to tell if it changes JIT settings. I suppose a benchmark site could tell me - anyone have one? I’ve Ventura and can test.

It would be nice to 'ave JIT disabled by default and then you could selectively turn it on on sites you really need it for, if any exist.

Literally any Javascript benchmark in Lockdown vs not Lockdown will tell you. Their performance is horrid without JIT, because they’re nothing but Javascript compute in hot loops - the sort of thing JIT is ideal for.

At least on iOS, this is how Lockdown mode works. It disables all the stuff, but you can go to the settings for a specific site (domain) and disable Lockdown - you get everything back, not just JIT, so webfonts, WebGL, etc. But it’s a per-domain toggle.

So on a fresh install on an older Intel MacBook Pro I get 150.343 at jetstream2 on browserbench.org and after lockdown is on, I get … well way slower as it’s still running hah

Well, there’s your answer! :smiley:

I don’t have anything that will run Ventura. My most recent, and likely to be last ever, is a 2015 MacBook Pro. Nice machine, figured it would be the last given the 2016+ keyboards, then Apple went and went nuts, and put out a nice laptop, but anymore I have no reason to have a recent Mac, and I don’t really trust them. The iPhone 2020 SE is… tolerable, barely, but I moved away from Apple hardware and don’t see a reason to move back.

My Rock5s are here, though!

Yeah it never finished, tried running overnight and Safari ended up killing the page for reasons.

The M1 is nice - I’ll give it that.

But Lockdown on macOS Ventura does disable JIT entirely, so there’s that.

My M1 Mini was the best system I’ve ever used, even in the original M1 with 16GB RAM form. I still can’t believe how well it chewed through x86 binaries.

Now the real question is, “Do you notice any speed difference in actual browsing of things that aren’t JS benchmarks?”

If you’re running Qubes, putting this in a templat’s /lib/firefox-esr/defaults/pref/autoconfig.js will disable JIT on all VMs based on that template.

// Comment to start the file.

pref("javascript.options.baselinejit", false);
pref("javascript.options.ion", false);
pref("javascript.options.wasm", false);
pref("javascript.options.asmjs", false);

I didn’t notice it such that I forgot it was still on, but to be fair that wasn’t my main laptop.

For normal people I suspect they’d be just fine enabling it, and I wouldn’t be surprised if this eventually becomes one of those “default off, ask if it should be on per site” like the camera and the microphone are now.

I believe Microsoft has started doing exactly that with Edge - there are a few settings that amount to various levels of “Trust the common sites,” or “Trust your common sites,” or “just leave it off.”

It seems to have been performance gains without concern for the consequences or the actual real world performance improvements - like how a 500hp car doesn’t have much impact on commute times.