Earlier quoted context omitted.
I agree with most of what you said, but LinkedIn, at least at a superficial level, is the absolute worst to me. It's full of a bunch of inspiration-porn bullshit that I find unbelievably mind-numbing, but also people treat it like Facebook and post a bunch of political and divisive shit on there as well. I wouldn't care if people posted political and divisive shit, and I would really prefer to delete it, but now a lo…
now a lot of job applications require that you give them a LinkedIn URL. What types of jobs? I find that very hard to believe.
LinkedIn uses 2.4 GB RAM across two tabs
431–440 of 481 posts
Re: LinkedIn uses 2.4 GB RAM across two tabs
#432Web developers of HN: how is this possible? What can use 1.2GB RAM for a website? Preloaded all videos?
Honestly, while I'm sure Linked is bloated, HN in Chrome is taking 204meg for the front page on my MBP. That's with no images, no videos, a minimal amount of css. `document.body.textContent.length` says 4278 Checking again it went down to 78meg. Still 78MEG!!! Thats over 1200 Apple IIs, Commodore 64s. I use to run Windows 3.1 for Workgroups, and in it run Microsoft Word, Excel, etc, on machines with 4meg. Now, a simp…
I just took some heap snapshots of this HN discussion page. Each JS heap snapshot was about 25MB and that does not include Blink native state or GPU bitmaps. The tab itself is taking ~100MB.
This isn't rendered bitmaps. Those get passed to the GPU process and uploaded to VRAM. That is just in-memory state required to render a very simple textual page with no images on it.
Where does it all go? Looking at the 25MB, the top memory user is anchor elements, 0.75MB is just the memory needed to represent links. This is where we start to get a clue as to the problem. An HN comments thread has a lot of links next to each comment, but they're very repetitive.
How would one implement this in a classical desktop toolkit? When we compare, we can see where the memory goes.
In the desktop era you would have implemented this with virtual scrolling in a customized list view - because it's easy and because the culture is to always do that. The APIs, sample code etc always pushes you in this direction. Additionally, there's much greater use of custom widgets that draw themselves on demand. Each comment would be a simple in-memory data structure, with zero RAM spent on UI. Each entry in the view would be an item in a listbox and Windows would request a paint of the entry as it scrolled into view (as comments don't stack horizontally). You'd have implemented a custom widget to render the text and the clickable links. The per-comment links (parent | context etc) would have been measured up front and then drawn with a single GDI DrawText. Mouse clicks would have been mapped back to the underlying text by using the measurements and then dispatched. The text would have been stored in a compact, typed, reflection-free in-memory data structure that stored only the comment, the UNIX time and an integer user id whose name would be looked up in a hashmap.
That approach is extremely memory efficient. The program itself translates business-level data structures to drawing calls just-in-time, and maps mouse clicks back to business-level operations with custom code. The OS helps out by supplying clipping, text rendering and pre-canned widgets, but devs have access to all the APIs from low to high level. However, it has downsides too. There is not necessarily any accessibility tree for screen readers, and things like changing the font size or selecting comment text are treated as nice-to-haves.
In a later era, maybe Swing or JavaFX or Qt, you'd no longer measure and draw the text yourself or map mouse clicks anymore. Data structures in RAM are less efficient now and GC lets garbage hang around. But the list view would still be virtualized by default. In virtualized list view, as the user scrolls it slides widgets off the top and then immediately repositions them at the bottom, so it's a bit like an escalator. As the list item is scrolled into view it's requested to mutate its internal state to match an entry in an underlying list of business objects. In web terms, the div is moved downwards in an absolutely positioned sense and then the text properties of the sub-divs are adjusted. As a result there are only a few UI objects being managed by the toolkit at once. The engine isn't expected to keep thousands of widgets off screen.
The web doesn't support this stuff well because it was never meant to be a GUI toolkit, so the path of least resistance is to:
• Generate one set of unique DOM elements for every business object.
• Use strings for everything. JS isn't strongly typed, browsers don't support any binary data transfer formats, so you can't store user IDs as small integers and do just-in-time hashmap lookups to render the usernames.
• Duplicate everything incessantly. Every comment has a bunch of anchors and the data for all of them is nearly identical (href, id, CSS class), but the web doesn't make it easy to deduplicate this. You could do it in theory but it's not trivial and not how anyone is taught to write apps.
To fix this the web would need to support what older toolkits called owner draw controls, but I think they're reluctant to do this sort of thing because the telos of the web is to treat web devs like children - they aren't trusted with low level features because they might misuse them or get them wrong, or because it's hard to implement and browser devs don't want to support it. The web's approach to multi-threading or native code is a good example of this mentality in action. Owner draw controls and virtualized list views expect more of devs, and the HTML designers don't want to expect more, they want to expect less. So we get web pages that take gigabytes of RAM.
Re: LinkedIn uses 2.4 GB RAM across two tabs
#433I don't understand who uses that network anymore. Everytime I login it's all ai generated stories next to ai generated flavor images of people sounding like a parody of themselves ("what taking my kids to school taught me about business scaling"). Out of all places to doomscroll, why choose the one that feels like an episode of Severance?
You had me almost spit out my coffee. That's hilariously on point. My favorite is this: The LinkedIn Renaissance Man. It reads like this: "Visionary, Recruiter, Climber, Marathon Runner, Co-founder, Author. Father." That's the sales guys we charge with finding us jobs. Our past co-workers are all CEOs, CTO's, AI experts, and various flavor of Leonardo da Vinci that surely puts my income and achievements to shame.
It got a lot of traction with the algorithm due to lots of comments to the effect of "What??", but every time I pass by the screenshot in my photoroll, I have a little giggle about it.
Re: LinkedIn uses 2.4 GB RAM across two tabs
#434Earlier quoted context omitted.
the web interface
The official name is the AWS management console. Or just the console. The ‘dashboard’, the ‘interface’? Reminds me of coworkers who used to refer to desktop PC cases as the hard drive, or people who refer to the web as ‘Google’.
Re: LinkedIn uses 2.4 GB RAM across two tabs
#435The fact that they hijack scrolling to artificially limit scroll speed is insane to me. Feels like I'm trying to navigate through molasses
Re: LinkedIn uses 2.4 GB RAM across two tabs
#436Earlier quoted context omitted.
My company started using slack in 2015 and at that time I put in a bug report to slack that their desktop app was using more memory than my IDE on a 1M+LOC C++ project. I used to stop slack to compile…
The bug in Slack is that it uses Electron
Re: LinkedIn uses 2.4 GB RAM across two tabs
#437I don't understand who uses that network anymore. Everytime I login it's all ai generated stories next to ai generated flavor images of people sounding like a parody of themselves ("what taking my kids to school taught me about business scaling"). Out of all places to doomscroll, why choose the one that feels like an episode of Severance?
Re: LinkedIn uses 2.4 GB RAM across two tabs
#438Earlier quoted context omitted.
The bug in Slack is that it uses Electron
The overhead added by Electron is hardly that significant at this point, you can still use it to write significantly more efficient apps
Re: LinkedIn uses 2.4 GB RAM across two tabs
#439Earlier quoted context omitted.
I realize this is not an orthodox view, but WASM won't make the typical user have a better experience. I think it could improve Photopea, the various office suite programs, and perhaps unknown unknowns. But, much more important than the uncertain is the current Web which will become less accessible and closed. The ease in reverse engineering JavaScript has more than once shown negligence and malice by Website develop…
While web development is fine enough - spending a bit of time doing native development makes it feel like web technologies are very limiting in what experiences are possible. It's also very obvious how limiting they are in the quality of user experience, both for end users AND developers. The first thing to highlight is that multithreading is possible but extremely impractical on the web, and even if you succeed, it'…
Electron programs differ. I would like WASM on Electron, moreso, I do not want JavaScript in Electron programs. I only run programs without the browser's sandbox because I trust it will not be hostile. Electron makes it harder to install extensions and investigate its behavior, which removes the entire purpose of an interpreted neutered language.
I hate programming for the web, I rarely do it, because it is such a terrible experience. I don't doubt that browser-native WASM integration will improve it.
For a typical user, having a browser-equivalent experience for extensions on native binaries is practically impossible (game mods are rarely a good experience, even with developer support).
More important than all that, which you are missing, is that all these websites, are not slow because of JavaScript; I am willing to bet (I really am) that the performance of these websites will not improve with WASM. To clarify, I do not doubt that WASM is faster than JavaScript, rather, I doubt that those that made those websites, would have made a faster website using WASM. I support my claim with the following:
- The plethora of terrible native programs that are regularly made by those same organizations (Visual Studio; a native program, which should be faster than any WASM program, is much slower than VS Code. VS Code has less features, but how many features would you need to remove from Visual Studio to achieve VS Code's performance; or for a long shot, Zed's performance). - Computers have gotten thousands of times faster, and, yet those programs have gotten slower, in absolute terms. See my argument about functionality in the previous point (all AWS does is render text, how could they have made it to be that slow). - Other, more complex tasks are done in JavaScript with good performance, no doubt they would be faster executed on WASM, but it takes from their excuse when you have a demonstrative example to the alternative. - I find that it is rare if ever that performance is addressed in those organizations, only when a program is unbearably slow, does someone then try and improve it, still, a thousand cuts kill.
Please remember that through all that, I am not arguing against WASM for no reason, but for very severe usability concerns. 10 years ago, rarely did a website offer a dark mode, but, it is my belief that extensions such as dark reader allowed for mass adoption. It would deprive those many with particular accessibility needs their ability to control the execution of these programs. Websites are nowadays the primary interface with government and banking services.
My banking app requires location access to function, it is a pain for end users to spoof it (although it does not deter any bad actors who were dedicated enough to get access to your credentials), yet the same bank (and the regulators that mandate it) do not bother to require that for the web, because spoofing it there is trivial.
Unfortunately, we can't fix the whole world's problems, but we can prevent them from ruining the web.
Finally, I am sorry for writing such a lengthy reply, and thank you for your time. :/
Re: LinkedIn uses 2.4 GB RAM across two tabs
#440Earlier quoted context omitted.
The overhead added by Electron is hardly that significant at this point, you can still use it to write significantly more efficient apps
The overhead of an entire browser engine isn’t significant compared to a native app?