Why does a barebones browser work so much faster than literally any other browser?

Discussion in 'macOS' started by darnocs, May 6, 2019.

  1. darnocs macrumors regular

    Joined:
    Jul 24, 2009
    #1
    There are regular debates between Chrome, Safari, and Firefox re: which is “fastest” (typically @ loading pages), but I was wondering what factors go into making a browser “fast”? I “built” a web browser app in Xcode a while back that uses the WebKit rendering engine: it’s literally just the webkit engine with a few buttons on top. It’s the most barebones of all browsers, and things like the rich version of Gmail are not supported on it. However, if I’m wanting to look up a website in a pinch (i.e., go from completely not running to doing a google search or going to a specific site in 10 seconds), it’s my go-to.

    What factors go into making a browser “fast” and how do you maintain a speed that is pretty comparable to this barebones browser while also adding in a few “normal” modern features?
     
  2. Jyby macrumors 6502

    Joined:
    May 31, 2011
    #2
    Plugins and extensions... Third party browsers are going to run slower if they depend on slow public APIs operating systems expose... That used to be the case in early Chrome days- which is why Apple's Safari smoked all browsers for a bit. But then APIs third parties could use got better / third party browsers didn't have to rely on them anymore..

    Also, use of RAM (memory) gives a boost. Chrome is a memory hog which I suspect is the reason its so fast compared to other browsers that are more careful about the memory they use. If Safari and Chrome were constrained to a small finite amount of memory, Id bet Safari would perform better than Chrome.
     
  3. chown33, May 6, 2019
    Last edited: May 6, 2019

    chown33 macrumors 604

    Joined:
    Aug 9, 2009
    Location:
    betwixt
    #3
    The speediest thing is what you don't do. Don't fetch a resource. Don't interpret some HTML tags. Don't run some JavaScript. All those things you don't do take exactly 0 time, so when you're trying to go fast, focus on not doing things.

    There could be any number of reasons your simple Webkit browser is so much faster. I'll bet it comes down to what it's not doing. Start by asking yourself why it doesn't work with "the rich version of Gmail". If you can discover that, you'll probably have much of the answer, or at least the beginnings of an answer.

    For example, if it doesn't interpret JavaScript at all, that'll be a whole lot of Things Not Done, especially in these days of myriad cookies, trackers, and tie-ins to social media.

    If your minimal browser does interpret JavaScript, maybe it's only a subset, or it's an older version that doesn't run the trackers and tie-ins correctly. If there's any reason at all that's stopping some JavaScript from running or from loading other resources, then those are Things Not Done.

    You could monitor or log the network connections your browser makes, and compare it to what other browsers do. Even a simple count of the number of different servers hit could offer some big clues. The next step up from a simple connection count would be a data count across all the connections to load a page (sum of all resource transfer sizes).
     
  4. pshufd macrumors 6502a

    Joined:
    Oct 24, 2013
    Location:
    New Hampshire
    #4
    Run email on Apple Mail or Thunderbird. All of the formatting in Javascript is now done in a compiled executable.
     
  5. Fishrrman macrumors P6

    Fishrrman

    Joined:
    Feb 20, 2009
    #5
    OP:

    How about putting up a copy of your "barebones browser" somewhere, so that we all might try it?
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    Location:
    betwixt
    #6
    I suggest putting the complete source project on a public repository like Github. Or maybe it's already stored on one, and all that's needed is a link.

    A downloadable executable would also be useful, for people who can't built it themselves. Of course, that executable comes with its own set of risks.
     
  7. pshufd macrumors 6502a

    Joined:
    Oct 24, 2013
    Location:
    New Hampshire
    #7
    It sounds like he just built a basic browser on WebKit. Probably directions on the web to do that.
     

Share This Page

6 May 6, 2019