
Making tab switching faster in Firefox with tab warming - bpierre
https://mikeconley.ca/blog/2018/01/11/making-tab-switching-faster-in-firefox-with-tab-warming/
======
cryptonector
I want this off. I know there's a setting.

What I _really_ want is to be able to open a link in a tab and _not_ load it
(much less render it) until I switch to that tab. Why? Because I sometimes
open lots of tabs and don't want those pages to have scripts running even from
origins I allow (via NoScript) until I say it's OK (by switching to the tab).

Think of it as ephemeral bookmark that I want to get to _later_.

~~~
ksec
I actually want it the other way around. I want those Tab to be loaded in
lowest priority, once they are finished rendering, pause it for eternity until
i switch back to it.

So I literally want a snapshot of it staying there. This way when i switch to
it, it should be close to instantaneous.

I have been thinking of another Idea, when unread tabs reach a large number,
these tabs were once opened, but inactive or not touched for a period of time
because i didn't have time to read it yet, should automatically move off to
another Window. And this Window should be designed to have Tabs on the side,
and some other changes making it more of a reading session rather then
browsing / surfing session.

Why not bookmark it or Pocket it, because these action will simply means i
will never touch them again or I forget about it.

~~~
KozmoNau7
"Why not bookmark it or Pocket it, because these action will simply means i
will never touch them again or I forget about it."

My view is those pages don't actually matter to you, they're irrelevant and
you won't actually miss them.

~~~
yitosda
A common response.

As a reluctant user of tree style tabs (holding out for the restoration of tab
groups), I disagree.

I usually have different sets of tabs open:

    
    
      - A set for each of the 2-3 projects I have active this month
      - Casual browsing
      - Read later
      - Do later
    

This adds up easily to one or two hundred tabs -- and these aren't bookmarks.
Bookmarks aren't gone when you close the tab, which is the desired behavior
for all the above cases.

Pocket or similar (ignoring my refusal to use a 3rdParty service for my own
data) would only be useful for do-later and read-later.

With tab groups I had a perfect setup which supported /all/ my use cases in
one go. With TST I can roughly approximate this with a top-level tab for each
(it's not great).

Bookmarks need to be replaced with something that covers a wider range of use-
cases without having to cobble together a bunch of different workflows.

People know about bookmarks and pocket. Most people who are actively searching
out extensions are not avoiding learning a different workflow (obvious if you
think about it). I've gone through many different workflows, and I'll keep
testing out more. Tab groups was the best thing yet for me.

~~~
KozmoNau7
I know it _seems_ like all of those things are important to you, but they
really aren't.

They're mostly just passing momentary fascinations, so either act on them or
let them go. If something actually _is_ important, you'll come across it
again, or simply remember it.

I struggled for years with tons and tons of unread tabs, forgotten bookmarks,
endless unstarted projects, hundreds of unwatched movies, unlistened albums.
Learning to just let them go was the best thing that ever happened to me. The
important stuff tends to stick around in memory, all by itself.

As a small part of that, I've instituted a "24 hour minimum" rule. If I see
something I like, I add it to the shopping basket or save it in some other way
that's not immediately visible when I'm on my PC or phone. Then I wait at
least 24 hours. If I _still_ desire that item after the waiting period has
passed, I'll consider buying it. It has saved me so much money, and helped me
avoid a ton of junk that would otherwise just be taking up space in my home.

Keeping too much stuff "active" is stressful as hell, and it's wonderful to be
able to just not care about it.

~~~
yitosda
I see your point, and it looks like I replied to the wrong person. Your points
likely apply to my read-later and do-later groups. (I might argue, but should
probably take it to heart first).

My point about bookmarks and pocket not filling my use-case (even if I dropped
read/do later) stands -- I really do want multiple switchable tab contexts.

------
Nrbelex
Neat. This technique seems to be based on hovering over a tab with the mouse.
Power users likely to benefit most from this optimization likely cycle through
tabs using ctrl+tab. Is any thought being given to a way to implement the
technique for ctrl+tab users?

EDIT: Just spotted the FN saying "Right now, we simply detect whether you’re
hovering a tab with a mouse to predict that you’re likely going to choose
that, but there are certain more opportunities to introduce warming based on
other user behaviours." Hopefully ctrl+tab is one of those behaviors it can be
baked into.

~~~
crondog
I can already see the bug report -- 'my CPU usage shoots up when I hold down
ctrl.'

~~~
tekacs
So [https://xkcd.com/1172/](https://xkcd.com/1172/) ?

------
cryptoz
> And in the event that we were wrong, and you weren’t interested in seeing
> the tab, we eventually throw the uploaded layers away.

No comment on the increased CPU usage/effect on battery life this might have.
I haven't tested it yet, but it seems like it could be significant. I hover
over way more tabs than I switch to sometimes.

I currently have a lot of tabs open (in Chrome) and I switch frequently.
However, I hover over a tab only to read the title, rarely to click. I'm
interested in checking out Firefox again soon to see the new performance gains
(maybe including this one), but does it affect battery life?

What if the false positive ratio is nearly 100%, like I suspect it would be
for my patterns? Does this affect other performance like scrolling or typing
if I've also been hovering over a lot of tabs?

Interesting work!

Edit:

> Maybe this is my Canadian-ness showing, but I like to think of it almost
> like coming in from shoveling snow off of the driveway, and somebody inside
> has already made hot chocolate for you, because they knew you’d probably be
> cold.

How sure are you that you won't end up with a whole bunch of hot chocolate
that nobody wants? What is the waste factor when the extra work is done
unnecessarily?

~~~
hafta
> How sure are you that you won't end up with a whole bunch of hot chocolate
> that nobody wants? What is the waste factor when the extra work is done
> unnecessarily?

This is one of the things telemetry data can be used for. We can include
telemetry probes in the browser that tell us what percentage of the time users
end up switching tabs after hovering. Then we can make informed decisions
about whether the feature is worth the extra complexity (and CPU cycles)
before any development work is done. As far as tailoring the feature to
individual browsing habits, telemetry could inform whether or not that would
be worth implementing.

~~~
tjoff
And I guess this wouldn't be possible with opt-in telemetry?

~~~
Sylos
Not reliably, as only power users will ever even consider opting into
telemetry (or changing pretty much any setting for that matter). And power
users generally have a much clearer layout of the tabs in their mind and will
always go straight up and click, rather than ruffling through the tabs for a
second. Or something like that. You get the idea, behavior here is simply
different for power users and those are who you'll reach with opt-in
telemetry.

Also has to be asked, though, what's the point in making this opt-in? Is it in
any way sensitive information whether you click after hovering a tab? I also
prefer being more cautious than is necessary, because sometimes there just is
some privacy implication you didn't think of, but with this the risk seems
incredibly low and they do have a clearly defined use for the telemetry.

------
whatshisface
This reminds me of that javascript technique where you load a page as soon as
you detect a mouseover on the link.

[http://instantclick.io/](http://instantclick.io/) (try their documentation
page for a demo of link-clicking)

~~~
mehrdadn
Very cool. Do you know if it behaves correctly with caching (e.g. Forward/Back
buttons)? Generally speaking, Javascript modifications to a page cause
inconsistencies with what the user sees when Back is pressed (and it seems
impossible to avoid this?), so I'm wondering if this is a caveat here as well.

~~~
whatshisface
For a while it has been possible to manipulate browser history with pushstate
and popstate, including the URL that shows in the address bar. I believe that
for a while now it has been possible to fully imitate a conventional website
on a single "page." (A while ago, I worked on doing this on a job where we had
to keep a websocket open at all times.)

------
barrkel
Hmmm. I don't notice a delay on switching to the wavey tab loaded in the
background.

~~~
testplzignore
Same for me - switching to the wavey tab is instantaneous. However, I do see a
~500-1000ms delay when switching _from_ the wavey tab to any other tab.

------
ars
Maybe it's just me, but switching tabs to this HN page takes longer than his
"wavey" example page.

On Firefox 52.5.2.

~~~
darklajid
Both are instantaneous on 59.

Are you staying on 52 for a reason? Is that a ESR version and you require some
addons that cannot be ported?

~~~
ars
> and you require some addons that cannot be ported

Yup, Tab Groups. Plus I need the Unity 3D extension, and ALSA sound (which
they also disabled). And Flash (although I know that's still supported for
now, I'm never not going to need it - even years from now).

I have no idea how I'll ever get off that version. Really not pleased with
Mozilla. I can't even go to 57.

My current plan is to keep 52 forever, and once it's not supported use the
latest version for normal browsing, and launch 52 when I need it. Maybe in
some kind of sandbox, since I'm sure there will be unpatched vulnerabilities.

I'll have to do something about all my Tab Groups though - I have around 20 or
30 of them, really not looking forward to migrating them, but I'll have no
choice. And I'll have to install PulseAudio.

I've been using Firefox since it was a beta project (even have bugzilla
reports from 1999) and I've never been as disappointed with them.

Edit: I know we're not supposed to ask, but I just have to, why did two people
downvote this? What could possibly be there to downvote? Am I not allowed to
have an opinion on Mozilla or something?

~~~
darklajid
Thanks for that.

There are various solutions to tab groups out there, I thought? Just recently
my Nightly seemed to have something like that natively (can't find it again
now, but it allowed me to categorize tabs into groups)?

Cannot comment on Unity. I wasn't aware that Firefox requires Pulseaudio, but
I've never understood the resistance against that project either - let's
consider it a preference.

But why are you personally disappointed with Mozilla? Do you believe that the
browser got worse for the general case or is this the feeling of being left
out at the side of the road because you have special & specific requirements
and preferences that aren't completely common?

(I didn't downvote you and I always had and have personal issues with Firefox
myself - but I believe that it's becoming a more and more improved browser for
~everyone~ insofar as that's possible)

~~~
ars
> There are various solutions to tab groups out there, I thought?

Not when I last checked. The only solution is either a separate browser window
for each group of tabs, or put them in bookmarks.

> I wasn't aware that Firefox requires Pulseaudio, but I've never understood
> the resistance against that project either

I can deal with PluseAudio. It's just annoying since I've never set it up, and
I don't need it - except for Firefox.

> But why are you personally disappointed with Mozilla?

Because they have caught the bug that to make things better you have to remove
things.

It's one thing to make an alternative - like when they ruined the UI, but
created "Classic theme restorer", it's another to remove features that people
actually use.

Right now, Unity and Flash are better than any kind of native web technology.
They just are. But Firefox is removing them anyway because of "purity"
reasons.

> Do you believe that the browser got worse for the general case

Yes. Not everyone is affected equally of course, but removing things like
Unity isn't a net win. Nor is removing Flash. I know, I know, not pure. I
don't care. Removing flash removes so much stuff from the internet.

> or is this the feeling of being left out at the side of the road because you
> have special & specific requirements and preferences that aren't completely
> common?

No, I can't expect that. Honestly I can (and will) deal with Tab Groups and
PulseAudio. PluseAudio especially I can understand. And I guess few people
used Tab Groups.

But Unity and Flash, that's just unpleasant.

> but I believe that it's becoming a more and more improved browser for
> ~everyone~ insofar as that's possible

It has in some ways. But they also messed up really bad. For example they
switched to WebExtensions before creating a replacement API that Tab Groups
would need! Read this if you haven't already:
[http://webcache.googleusercontent.com/search?q=cache:lXF50-h...](http://webcache.googleusercontent.com/search?q=cache:lXF50-hgOnsJ:fasezero.com/lastnotice.html)
(he gave up his DNS, that's how badly Mozilla burned him).

Why do that?

They removed NAPI without leaving any possible alternative.

Make the browser better by improving it. Stop making it better by not
supporting things. Look at Linux "Never Break Userspace". Linux has things
that are hard to support, but they deal, because it's the right thing to do.

~~~
darklajid
Reading some more into tab groups I guess I understand what you're missing
(I'm using Tree Style Tabs, which Work For Me™). The biggest/last blocker
seems to be [1].

Pulseaudio? I think that shouldn't be a big issue imo, but you seem to agree
here.

"Ruined the UI" is a tough one. For me the UI is completely fine and what
isn't can be fixed in userChrome.css with little investment. What's broken or
ruined?

Still unclear about Unity, are you talking about this [2]? It seems to say
that this is unsupported/deprecated by the company itself [3]?

Hopefully you'll be able to migrate to a current version in the future. The
'start 52 in a sandbox' scenario doesn't sound fun at all.

1:
[https://bugzilla.mozilla.org/show_bug.cgi?id=1384515](https://bugzilla.mozilla.org/show_bug.cgi?id=1384515)

2: [https://unity3d.com/webplayer](https://unity3d.com/webplayer)

3: _The Unity Webplayer is no longer supported. We provide this download link
to the last build for convenience, but be aware that the Unity Webplayer has
been deprecated and will not get any further update.

If you want to deliver Unity made content via web browser we recommend you use
WebGL._

~~~
ars
> What's broken or ruined?

I don't remember right now, but I do know I had to install the extension in
order not to find the UI unpleasant.

> Still unclear about Unity, are you talking about this [2]?

Yes.

> It seems to say that this is unsupported/deprecated by the company itself
> [3]?

It was depreciated right after Mozilla announced they would no longer support
it - Unity had no choice at that point. I can't imagine they were very happy
about it, it all but destroyed their company.

~~~
darklajid
I'm confused. I thought Mozilla has a really shitty market share. Everyone
just cares about Chrome?

And I assume this plugin wouldn't work in Chrome (does it)?

How does a web player plugin come close to destroy a company that builds a
graphic engine? I thought they make their money with licenses for game
developers?

So far I understand your usability complaints, but this seems to go a bit far.
At least without sources, couldn't find something myself. Mozilla all but
destroying Unity because of their plugin/addon policy seems .. unlikely?

~~~
ars
> And I assume this plugin wouldn't work in Chrome (does it)?

It used to - till Chrome disabled NAPI, but for a while you could reenable it,
till eventually it was removed altogether.

It used to work on all browsers, then one by one it stopped working, Mozilla
was the last straw.

The company has pivoted, so I guess they'll be all right, but their thing was
a 3D graphics that worked everywhere. Now it's 3D graphics that you can build
for many platforms - similar, but not exactly the same.

One nice thing about the web plugin was that it worked on Linux, and very few
other 3D games worked on Linux, unless specially written for it.

> Mozilla all but destroying Unity because of their plugin/addon policy seems
> .. unlikely?

Yah, I'm going to far. Mozilla was the last straw rather than the main insult.
I blame Mozilla because Firefox was what I used, I didn't really notice when
it stopped working in Chrome (other than some posts urging people to install
Firefox, which I thought was cool).

But today, right now, there are still a ton of Unity Web games that will soon
be unplayable by anyone not running old code, and I find that sad, that all
that work is just gone, destroyed.

Read this: [http://www.ocsmag.com/2017/04/29/kde-vs-gnome-design-
philoso...](http://www.ocsmag.com/2017/04/29/kde-vs-gnome-design-
philosophies/)

I want Mozilla to be like KDE, not Gnome.

------
lxe
Chrome doesn't seem to suffer from "cold" tabs. Navigating to the page in the
example ends up rendering it instantly. Does Chrome have different background
rendering techniques than Firefox?

~~~
moz23
Yes, it loads all tabs at startup. That's not a good thing, starting
chrom[e/ium] on my old laptop is not a very fast experience, even on my work
machines it takes a while.

------
stuaxo
Great, I want this for when I am hammering Ctrl+Tab or Ctrl+Pageup/Down for
the next/prev tab as well.

------
mrtweetyhack
This is the same kind of shit many software product do by loading their
product at startup, their product starts instantaneously. They don't care that
it takes up memory, slows startup times, bogs down the computer in general.
Another way Mozilla is trying to cheat browser tests at the cost of users.
They also sneakily delay loading of certain websites. While I despise these
websites, I already have a way of dealing with them by blocking them
altogether(no thanks to Mozilla) but Mozilla wants to cheat so that people
will think Firefox is fast. Next, they'll load Firefox on startup but keep it
hidden. When you "start" it, it appears instantly. Wow. Faster the Chrome.
This is also the same kind of shit that pushes users to throw PCs away because
it can't handle newer much more bloated software. Thanks for the extra bloat
Mozilla, you bunch of slimy cheaters.

~~~
pcwalton
There aren't any artificial benchmarks I'm aware of that would benefit from
this feature.

------
nkkollaw
So sad, all this effort to make Firefox better, and they keep ruining
everything with questionable marketing stunts.

Hard to recover from the add-on fiasco, IMHO.

------
DeepYogurt
I can foresee tracking issues with this if every link I hover over gets pre-
fetched then a good dead of network traffic will be generated that otherwise
wouldn't. In particular if I don't follow a number of links which I hover.

~~~
dao-
This is all about rendering already loaded pages. Nothing will be prefetched
for this.

------
bitcoindev
anyone knows how to fix this fundamental firefox flaws why the hell there is
no handle window [https://stackoverflow.com/questions/48218471/how-to-run-
fire...](https://stackoverflow.com/questions/48218471/how-to-run-firefox-
without-a-window)

------
alistproducer2
Cool stuff, but can I be crotchety for a sec? I wish we could dispense with
all of the cute names given to features, techniques, abstraction, etc that are
not intuitive until someone tells you what it means.

No one would have any idea what the hell "tab warming" means without being
told, which seems unnecessary for something that is a simple concept to
understand. It increases the cognitive load in a field that already has a lot
of it. Please just give your hack and techniques descriptive names; or better
yet, think long and hard whether or not the thing even needs a name. "pre-
render on hover" would suffice. It's one more word and I know exactly what it
means instantly.

~~~
kakarot
I understand your point, but in this case I understood the concept of tab
warming upon reading the name.

~~~
uuoc
Seconded. I knew exactly what concept was going to be introduced the moment I
read "tab warming".

