← Back to context

Comment by vunderba

1 day ago

PSA for those who aren’t aware: Chromium/Firefox-based browsers have a Network tab in the developer tools where you can dial down your bandwidth to simulate a slower 3G or 4G connection.

Combined with CPU throttling, it's a decent sanity check to see how well your site will perform on more modest setups.

I once spent around an hour optimizing a feature because it felt slow - turns out that the slower simulated connection had just stayed enabled after a restart (can’t remember if it was just the browser or the OS, but I previously needed it and then later just forgot to turn it off). Good times, useful feature though!

  • hahaha - I've done something similar. I had an automated vitest harness running and at one point it ended up leaving a bunch of zombie procs/threads just vampirically leeching the crap out of my resources.

    I naturally assumed that it was my code that was the problem (because I'm often the programmer equivalent of the Seinfeld hipster doofus) and spent the next few hours optimizing the hell out of it. It turned out to be unnecessary but I'm kind of glad it forced me into that "profiling" mindset.

  • Have the same story but I forgot to disable tc netem on a server, luckily it was just staging.

  • I wonder if that works beneficial on old computers that freeze up when you try load the GB js ad-auction circus news circus website. I want to browse loaded pages while the new tabs load. If the client just hangs for 2 min it gets boring fast.

    • Datapoint: During the pandemic, I had to use an old 2004 Powerbook G4 12" (256 MB RAM, OS X Leopard). Everything sort of worked and was even reasonably snappy. But open one website, and the machine went down. Unusable. Even if, indeed, I just wanted to read or look up a few kB of text. So painful.

      9 replies →

I still test mine on GPRS, because my website should work fine in the Berlin U-Bahn. I also spent a lot of time working from hotels and busses with bad internet, so I care about that stuff.

Developers really ought to test such things better.

  • Thank you for doing this! I really mean it. We need more developers who care about keeping websites lean and fast. There's no good reason a regular site shouldn't work on GPRS, except maybe if the main content is video.

For macOS users you can download the Network Link Conditioner preference pane (it still works in the System Settings app) to do this system wide. I think it's in the "Additional Tools for Xcode" download.

This made me chuckle.

I had a fairly large supplier that was so proud that they implemented a functionality that deliberately (in their JS) slows down reactions from http responses. So that they can showcase all the UI touches like progress bars and spinning circles. It was an option in system settings you could turn on globally.

My mind was blown, are they not aware of F12 in any major browser? They were not, it seems. After I quietly asked about that, they removed the whole thing equally quietly and never spoke of it again. It's still in release notes, though.

It was like 2 years ago, so browsers could do that for 10-14 years (depending how you count).

  • That's great. Well, just to let them know if they ever need something like that in the future, I'm available for hire as an overpriced consultant.

    I guarantee with 100% satisfaction that my O(n^n) code will allow visitors sufficient time to fully appreciate the artistic glory of all the progress bars and spinners.

For Firefox users, here's where it's hidden (and it really is hidden): Hamburger menu -> More tools -> Web developer tools, then keep clicking on the ">>" until the Network tab appears, then scroll over on about the third menu bar down until you see "No throttling", that's a combobox that lets you set the speed you want.

Alternatively, run uBlock Origin and NoScript and you probably won't need it.

  • What a weird comment, not sure what you are trying to achieve. Any web developer knows how to find the network tab of the web developer tools in any browser including Firefox, and then the throttle option is immediately there.

    You can make it look like any feature in any UI is hidden by choosing the longest path to reach it, using many words to describe it despite the target audience already knowing this stuff, and making your windows as small as possible.

    Moreover, that a developer tool is a bit hidden in submenus in a UI designed for nontechnical users is fair game.

    Even considering this, right click > inspect or Ctrl+shift+k also gets you the web developer tools. Not that hidden.

    And then usually the network tab is visible immediately, it is one of the first tabs unless you moved it towards the end (even then, usually all the tabs are visible; but it's nice you can order the tabs as you want, and that a scroll button exists for when your window is too small -- and if the web developer panel is too small because it's docked at the left you can resize it, dock it to bottom or undock it).

    This stuff is pretty standard across browsers, it's not like Firefox's UI is specifically weird for this. I don't have ideas for improving this a lot, it looks quite well designed and optimized to me already.

    And then no, ublock Origin and No Script can't help you optimize the size of the web page you are working on. You ought to unblock everything to do this. They are a solution for end users, who have very few reasons to use the throttle feature. And unfortunately for end users, blocking scripts actually breaks too much to be a good, general workaround against web pages being too heavy. I know, I browse the web like this.

    •   Any web developer knows how to find the network tab of the web developer tools 
      

      Exactly. As you point out, any web developer. My comment was aimed at helping out people who aren't web developers.