News for hackers. Stuff that matters.
Re:Your CPU may have slowed down on Wednesday by miltondts on Tuesday June 22, 2021 @06:38AM (#27589999)
Yeah, all this concern with scalability, portability and clean code, has created quite a dystopian software world.

A world where software can barely fit in a single machine and can only scale up. In many cases, this software doesn't even do anything that is functionally different from 10 or 20 years ago, but it still consumes many more resources.

A world where some websites still don't work properly across web browsers. Electron apps which should enable easier cross platform applications, don't (e.g. Microsoft Teams doesn't have feature or even UI parity in windows and linux).

A world where clean code destroys performance, because the time of developers must be paid for by the company, but the costs of resource wastage are externalized. And there isn't even any evidence that these practices actually help to do what they are supposed to do!

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @10:18AM (#27591921)
> In many cases, this software doesn't even do anything that is functionally different from 10 or 20 years ago, but it still consumes many more resources.

Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples? Nah, having lived and written code through the last 20 years, I think this often repeated argument just isn’t true at all. I can see why it’s easy to jump to this conclusion and easy to believe, if you don’t know or don’t pay attention what’s under the covers. It’s easy to forget about all the conveniences you’ve gotten used to along the way. You wouldn’t agree the functionality is the same if you tried using software from 20 years ago.

One easy to overlook difference is displays. It’s easy to forget that 20 years ago we had 800x600 screens, 24 bit color was not ubiquitous, and 60hz monitors were practically non-existent. Today 4K is normal, and combined with refresh rates and colors, we’re pushing upwards of 2 orders of magnitude more data to our screens. We have much better compositing, much better text and graphic rendering, better antialiasing, all around higher quality and faster rendering.

YouTube and Netflix didn’t exist 20 years ago. Browsers were incredibly slow and couldn’t support streaming video or anything but the smallest of applications written in JavaScript. Localization didn’t exist, web analytics wasn’t really a thing, browsers didn’t run background tasks.

> A world where some websites still don’t work properly across web browsers

This specious framing might have you believe that web portability hasn’t improved that much, while in reality the difference in support for web standards has changed dramatically in the last 10 years. Supporting IE6 was a real and widespread problem for businesses compared to the few minor corner cases that are left.

Re:Your CPU may have slowed down on Wednesday by erik on Tuesday June 22, 2021 @11:45AM (#27593151)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

Compare basic document editing in Office 365 with Office 2000 running on Win2k. Sure, 365 has loads of additional functionality, and your data follows you across devices. But the base user experience is largely worse.

> It’s easy to forget that 20 years ago we had 800x600 screens, 24 bit color was not ubiquitous, and 60hz monitors were practically non-existent.

This was maybe the case in the mid-90's. But by the late 90's 1024x768, 85hz, and 24 bit color were standard. 1280x1024 and even 1600x1200 were not uncommon.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @12:58PM (#27594134)
> Sure, 365 has loads of additional functionality

Right, so you’re agreeing with me and disagreeing with @miltondts? UX isn’t what we were discussing.

> This was maybe the case in the mid-90’s.

“In the PC world, the IBM PS/2 VGA (multi-color) on-board graphics chips used a non-interlaced (progressive) 640 × 480 × 16 color resolution that was easier to read and thus more useful for office work. It was the standard resolution from 1990 to around 1996. The standard resolution was 800 × 600 until around 2000.”

https://en.wikipedia.org/wiki/Display_resolution#Evolution_o...

Re:Your CPU may have slowed down on Wednesday by blihp on Tuesday June 22, 2021 @02:37PM (#27595400)
One problem with that entry: the PS/2 only ever had a minuscule share of the market. In the clone world, which was the lions share (think Dell, Lenovo etc of today), resolutions were all over the place. So 800x600 was often the minimum resolution many developers were targeting for things like dialog boxes etc in that timeframe. It's a fiction to say there was a standard during that time, there were many. From SVGA (800x600) on, it was more a combination of user preference, monitor capability and any minimum software requirements as to what resolution a given user would run. Unlike digital LCDs of today, analog monitors didn't care what resolution you ran them at as long as they could handle the horizontal/vertical frequencies you were throwing at them and the phosphor mask had the resolution needed. (and if it didn't have the resolution, the picture would just look progressively more blurry as you jacked up the resolution being sent to it)
Re:Your CPU may have slowed down on Wednesday by varjag on Tuesday June 22, 2021 @06:45PM (#27598260)
Yep: as broke students in early 90s we ran VGA on a 1970s era amber terminal display.
Re:Your CPU may have slowed down on Wednesday by _carbyau_ on Tuesday June 22, 2021 @11:06PM (#27600335)
I have been using 1600x1200 for 20 years. I had a single CRT. Later upgraded to two LCDs of the same res.(So I guess 3200x1200, but not for gaming.)

Then 1920x1080 didn't seem worth the cost.

Then gaming landscape changed and 60Hz is not a thing anymore, now it has to be 120+.

So have been waiting until 4k 120Hz+ and the money in my pocket meet.

Re:Your CPU may have slowed down on Wednesday by deckard1 on Tuesday June 22, 2021 @01:02PM (#27594184)
> 20 years ago we had 800x600 screens

My iiyama VisionMaster was doing 1600x1200 @ 90Hz and running Quake 3 just fine back in 1999/2000.

> better compositing, much better text and graphic rendering, better antialiasing, all around higher quality and faster rendering.

Thank you Nvidia, I guess? They have been carrying the water since the late '90s when everyone else dropped the ball.

But let's get something straight. When we went from CRT to LCD/LED we weren't picking visual fidelity. We, as a consumer base, picked convenience. Thin and light vs. great colors, contrast, viewing angles, refresh rates, etc. My first LCD was in 2004. It was an expensive top of the line brand. I took it home and the ghosting was incredible. Massive input lag. If you were sitting in your chair and just leaned back, all the colors would shift on the display. The viewing angle was nonexistent. I took it back the next day. We are just now getting to the point of matching a CRT from the '90s. And you may have noticed we still don't have OLED on the desktop.

Around that same time we all got stuck with perhaps the worst crime against monitor tech: 16:9 aspect ratios. Not only is that aspect not "cinematic" (theatrical 16:9 does not exist), but we're leaving tons of resolution and screen space on the table. Because your monitor will always have the same footprint due to the width, we could have much better vertical resolution if we stuck with 4:3. Consumer TV fads really hurt the computing industry.

> support for web standards has changed dramatically in the last 10 years.

Yeah well, Webpack, Babel, and numerous polyfills all say otherwise. We're only just now dropping support for IE11 everywhere. Maybe that's the light at the end of the tunnel? But I have my doubts. The incentives are too high for the web to fully standardize. Embrace-and-extend will continue. Developing for the web has never been more complex than it is today.

The other bit of sad news is that the web is no longer open. HTML5 is not an open technology. It requires proprietary DRM which only a few companies allow you to use.

> web analytics wasn’t really a thing

I'm going to shed no tears when Google Analytics finally dies.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @01:25PM (#27594475)
> perhaps the worst crime against monitor tech: 16:9 aspect ratios. Not only is that aspect not "cinematic" (theatrical 16:9 does not exist), […] we could have much better vertical resolution if we stuck with 4:3.

I’m confused by this. Film aspect ratios are even higher than 16:9, at 1.85:1 and 2.39:1. I don’t understand why you complained about 16:9 being not cinematic while suggesting 4:3 is better, could you elaborate?

Re:Your CPU may have slowed down on Wednesday by deckard1 on Tuesday June 22, 2021 @01:57PM (#27594877)
Sure. What I mean is at 16:9 you're still getting letterboxing (black bars on top + bottom). In addition to that, it's rather silly to think that just because 16:9 is closer to a theatrical ratio that you're going to ever get a cinematic experience sitting 2 feet in front of a 24" monitor. Or 6 feet in front of a 46"+ TV. We optimized all of our devices for viewing DVD content whether it ever made sense or not. Because home theater was where the money was.

4:3 is better because it fits the application better. What are you doing at your computer? Probably work or browsing the web. If you watch YouTube videos then you have a chicken-and-egg issue... YouTube content is 16:9 because that's what your device is (to see what I mean: look at all the vertical videos today... the content follows the device). YouTube/TikTok creators aren't using aspect ratio in an artistic manner because few of these people are even aware that they could have a say in the matter. Unlike say, Kubrick, who deliberately picks a ratio for each of his films. They are using what the prosumer cameras are designed for, which is all 16:9.

The point is: you're getting black bars if you watch theatrical content whether it's 4:3 or 16:9. The width of your computer monitor is a constant. So we lost vertical screen space for what? Nothing, that's what. Slightly less black bars on the top and bottom when we watch a Marvel movie on our desktop computer or laptop.

Re:Your CPU may have slowed down on Wednesday by philistine on Tuesday June 22, 2021 @05:55PM (#27597708)
While you are correct about movies not using that aspect ratio, I’d say 16:9 is a standard because of TV shows. With the advent of the glutton age of television we’re in now, people find value in a 16:9 display because of all the Netflix shows you can watch full screen on their laptop without bars.
Re:Your CPU may have slowed down on Wednesday by aidenn0 on Tuesday June 22, 2021 @07:09PM (#27598502)
16:9 is a compromise resolution. It's the geometric mean of 1.33 and 2.85 (TV vs Panavision).

> So we lost vertical screen space for what? Nothing, that's what. Slightly less black bars on the top and bottom when we watch a Marvel movie on our desktop computer or laptop.

It's not "nothing" that we lost; on a X" display with Y total pixels, the marvel movie will be larger and higher resolution on a 16:9 than it will be on a 4:3. This is true for any of the post 1960ish popular ratios for films: 15:9, 1.85, and 2.35.

Similarly, 4:3(1.33) content will use more pixels than it would on a 1.85 or 2.35 ratio screen.

Re:Your CPU may have slowed down on Wednesday by _0ffh on Tuesday June 22, 2021 @02:06PM (#27594997)
Yeah I was distraught by the complete eradication of 4:3 offers in just a few years' time. I think it was a marketing problem: In 16:9 you could suddenly offer screens with a greater diagonal without actually increasing (or even while decreasing) true screen real estate. Measured in inches/dollar, classic 4:3 was fighting with both hands tied behind it's back.
Re:Your CPU may have slowed down on Wednesday by fomine3 on Tuesday June 22, 2021 @09:44PM (#27599802)
I think diagonal inch unit for screen should be banned. It works as incentive to go for non-square aspect ratio. See smartphones getting longer even though we have eyes horizontally.
Re:Your CPU may have slowed down on Wednesday by pdimitar on Tuesday June 22, 2021 @01:58PM (#27594888)
I like this comment, thank you for it.

Would you be so kind as to clarify on this?

> And you may have noticed we still don't have OLED on the desktop.

I am pondering one the LG CX 48" OLED display but I have no clue what are the pros and cons.

Re:Your CPU may have slowed down on Wednesday by andrekandre on Tuesday June 22, 2021 @05:21PM (#27597379)
i have one, here are pros and cons that i have identified

1. if you sit about 1m or more away from the monitor, it might be usable in terms of size

2. it has brightness limiters, so if you have a mostly white screen (say a fullscreen diagramming app with a white canvas) the monitor will dim by about 50% so you will need to keep some empty space around your window of the desktop image visible (unless you are in complete dark mode for the app)

3. its a glossy display, so if you have direct light behind it wont work out well

4. 4k at 48 inches, the pixel density is a bit low, and if you do scaling of the ui its quite nice but then you loose the advantages of a large monitor to have more desktop space

5. darkmode + low light is brilliant

6. oled is beautiful (wish i could get it without the gloss though)

7. you will need a good enough gpu to get 120fps at 4k (laptop + egpu or latest macbook pro might work)

8. you will need a hdmi 2.0 cable to get 120fps at 4k

9. there are only hdmi inputs

10. if you want to prevent the timed autodimming (you cannot disable dimming completely (see 1) you will need to get the factory remote to disable it

11. to prevent damage to the oled, it auto shifts the screen output by about 5 to 10 pixels every few minutes in desktop/game mode (so you might notice the mac menubar is slightly cut off, thats normal)

12. the remote is a but wonky but cool... there are no direct shortcuts to brightness controls unfortunately... ---

it will also take while to get used to it.... it took me about 2 weeks to start liking the size... (i sit about 80cm from the monitor, deep desk)

honestly, if you sit close, say 50cm or less, a 32 inch 4k display will be better (like the lg 32 inch 4k displays)

edit: my dream monitor is 8k oled at about 38 inches (not ultrawide) and not glossy... thats a few years off i guess (and also who knows if they would make that size in non-ultrawide..)

Re:Your CPU may have slowed down on Wednesday by pdimitar on Tuesday June 22, 2021 @05:47PM (#27597639)
Thank you! Detailed and extremely useful!

Yeah, I'm never buying a glossy display again though. You helped me make a decision.

Re:Your CPU may have slowed down on Wednesday by dcow on Tuesday June 22, 2021 @04:05PM (#27596489)
The 48" CX is a TV. It happens to work pretty nicely as a monitor if you have enough space (between you and the display). But in a desktop setting where you are sitting 2 feet from the monitor, you'd have to physically move your head to see all the content. OLED on the desktop means 24", 27", 32" OLED displays.
Re:Your CPU may have slowed down on Wednesday by pdimitar on Tuesday June 22, 2021 @05:57PM (#27597721)
Yep, completely agreed on the sizes + viewing distance. I've been on the fence but I'll retrain myself from buying it. It seems it has quite a few downsides.
Re:Your CPU may have slowed down on Wednesday by MonaroVXR on Wednesday June 23, 2021 @11:02PM (#27613419)
Pros unlimited contrast, cons the TV doesn't age well. Since it's in the name. (Organic)
Re:Your CPU may have slowed down on Wednesday by SECProto on Tuesday June 22, 2021 @01:11PM (#27594298)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

From this end user's perspective, Google Chat is functionally no different than ICQ or MSN Messenger were 20 years ago. Notifications show up on my phone screen instead of my windows 95 screen. And now we call them emojis and there are more of them. And Google chat has more lag (~1400ms) when I open a chat window from my contacts list. All while the functionality of getting some text from myself to my friends has stayed identical (actually decreased - I can't use custom fonts/bold/etc on the modern version)

Re:Your CPU may have slowed down on Wednesday by FabHK on Tuesday June 22, 2021 @04:52PM (#27597049)
Datapoint: I've recently spun up my mom's old G4 Powerbook 12" (running OS X 10.5 Leopard) to rip some old CDs I found, and everything was reasonably snappy. Well, ok, a bit slow, but fine, really. Until I opened Safari. After some 3 or 4 tabs the machine basically ground to a halt. (Fair enough: 256 MB RAM and a spinning hard disk!)

Things got a bit better when I switched off JavaScript. But yeah. The web is basically unusable on older machines. For many use cases all I want is some text, maybe some images, maybe some forms and buttons. How hard can it be to render that?

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @01:19PM (#27594404)
Is Google chat using more resources and draining perf? The UX of a chat app is somewhat of a straw man here. None of the chat apps you mentioned “can barely fit in a single machine” or “destroys performance”.
Re:Your CPU may have slowed down on Wednesday by dijit on Tuesday June 22, 2021 @01:28PM (#27594512)
ahem slack?

But realistically Google chat uses more ram than the PC I used MSN messenger on even HAD.

And msn was “hoggish” for the time.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @02:17PM (#27595154)
Slack is vastly more functionality than MSN messenger.

How do you know the RAM usage of gchat? I agree Chrome uses more (and again it’s a completely different ballgame than it used to be) than but where are you getting the chat specific app metrics?

Re:Your CPU may have slowed down on Wednesday by dijit on Tuesday June 22, 2021 @02:50PM (#27595572)
> Slack is vastly more functionality than MSN messenger.

I don't buy that. Because you can attach bots? or make calls, custom emoji? (you can do all of these on MSN) and more (like theme customisations and font changes!)

> How do you know the RAM usage of gchat?

You can see each tab's memory usage with Safari on MacOS as it's tied into the Activity Monitor.

Google Cloud Console uses 989MB for me, for instance.

Re:Your CPU may have slowed down on Wednesday by fouric on Tuesday June 22, 2021 @02:58PM (#27595675)
> Because you can attach bots? or make calls, custom emoji?

And to add on to that - these features shouldn't have any noticeable resource consumption of the kind people are complaining about. Bots shouldn't affect performance at all. The ability to make calls should have no performance impact when a call is not being made. People aren't complaining about Slack with a call being slow - they're complaining about Slack taking a long time to start up, and Slack using lots of memory and CPU just sitting there doing nothing.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @03:04PM (#27595749)
> You can see each tab's memory usage with Safari on MacOS as it's tied into the Activity Monitor.

That's not necessarily a good proxy. Safari, like Chrome and Firefox over-allocate far more than they need speculatively for caching & rendering purposes. There was a whole blog post on HN that completely bungled memory metrics when looking at the integrated Activity Monitor https://news.ycombinator.com/item?id=26179817

Re:Your CPU may have slowed down on Wednesday by chalupa-man on Wednesday June 23, 2021 @07:48AM (#27603326)
> Because you can attach bots? or make calls, custom emoji?

Because you can access an indexed repository of every conversation your team has had, organized by grouping, channel, digression, and participants, even if you weren't present, online, or even a member at the time. What's the MSN Messenger approach to this? Everyone join one giant group conversation window and try to keep the conversation straight, everyone send every file to every person each time, everyone keep every file you've been sent, grep through your 5 years of logs to find stuff, and hope you never need to use a different device or lose your connection? Slack provides the ability to reply to specific messages in digressionary threads, which is a key part of keeping busy channels readable in the present, let alone in the future, and the only reason many conversations can span long periods without getting lost in noise. I shudder to imagine my job relying on staying up to date with an MSN Messenger window with 44 participants.

Then there's integration with the bugtracker and support ticketing system, and Keybase, putting live-updating views from spreadsheets and the database directly into chat, drop-in/out call channels (which aren't comparable to MSN/WLM's direct calls), compatibility channels to migrate from IRC and mailing lists without losing anybody... those don't count as extra functionality? There's a reason professional teams use Slack when they never used MSN/WLM.

Re:Your CPU may have slowed down on Wednesday by SECProto on Wednesday June 23, 2021 @12:58PM (#27606794)
Those advantages (offline file storage, sorting by subtopics and threads, access to things from before you were even a member) sounds largely like forum software from ~20 years ago too, which only required decent hardware on the server side. Integrated chat and forum software (with office software thrown in to boot). The original comment I had made was about MSN Messenger being functionally equivalent to Google chat.
Re:Your CPU may have slowed down on Wednesday by aidenn0 on Tuesday June 22, 2021 @12:14PM (#27593530)
> 60hz monitors were practically non-existent

?? 60Hz progressive scan was fairly standard for SVGA 20 years ago; people looked for 70+Hz displays because they were bothered by the flicker (my college roommate in 2001 ran at 1024x768@75Hz rather than 1280x1024@60).

800x600@60i was the bargain-bin monitor even in the late 90s. By 2001 you could get a used 800x600@60p or 1024x768@60p monitor for nearly free if you lived anywhere that had companies upgrading to higher resolution.

Re:Your CPU may have slowed down on Wednesday by nsxwolf on Tuesday June 22, 2021 @04:33PM (#27596829)
The 75 hz trick was such a lifesaver in offices with fluorescent lighting.
Re:Your CPU may have slowed down on Wednesday by caeril on Tuesday June 22, 2021 @01:54PM (#27594845)
Terminal emulation and text editors are the obvious ones, notably because DISPLAYING TEXT should be trivially fast in a world of multicore multigigahertz processors and GPUs with ridiculously fast shaders.

Casey Muratori has been running down the insane failings of terminal emulation lately:

https://twitter.com/cmuratori/status/1405342954194051073 https://twitter.com/cmuratori/status/1405347255511486464

Chaser: https://twitter.com/cmuratori/status/1405356794495442945

This is to say nothing of the fact that VSCode is the most popular editor on the planet and that the very notion of allocating several gigs of ram to embed a web renderer ( one that is constantly having to be patched for the annual round of UAF vulnerabilities ) in order to DRAW TEXT is the very height of inefficient idiocy.

Re:Your CPU may have slowed down on Wednesday by Tijdreiziger on Tuesday June 22, 2021 @03:48PM (#27596292)
> This is to say nothing of the fact that VSCode is the most popular editor on the planet and that the very notion of allocating several gigs of ram to embed a web renderer ( one that is constantly having to be patched for the annual round of UAF vulnerabilities ) in order to DRAW TEXT is the very height of inefficient idiocy.

If you just want to draw text, you can simply use Notepad or Notepad++. VSCode has a lot more functionality, though.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @02:46PM (#27595523)
That’s a completely different issue than what parent suggested. Terminals aren’t using more resources, they are just going slow - on any hardware, due entirely to lack of devs engineering for perf. Since Casey’s posts, a bunch of terminals and editors have upped their game, started using the GPU for rendering, and are now both faster and more efficient.

> allocating several gigs of ram to embed a web renderer […] is the very height of inefficient idiocy.

No doubt theres bloat around, but I think you don’t understand web browser allocation strategies. Chrome, Firefox, and Safari are allocating enormous chunks of ram for both caching purposes, and rendering efficiency. It’s extremely difficult to know how much memory is really needed for any given app, you cannot make the assumption that the RAM reported for any given app or page has anything to do with how much the page itself asked for.

You also lack justification for calling memory use idiocy if you aren’t running out of memory. As long as there is free memory in the system, it’s fair game, and does not represent inefficiency.

Re:Your CPU may have slowed down on Wednesday by fouric on Tuesday June 22, 2021 @03:10PM (#27595826)
> Terminals aren’t using more resources, they are just going slow

"Going slow* is using resources. Clock cycles are a resource.

> No doubt theres bloat around, but I think you don’t understand web browser allocation strategies.

Using a web rendering engine to render a text editor is still bloated and inefficient. It doesn't matter if web browsers are intrinsically expensive - building a text editor using webtech is the incorrect design decision.

> You also lack justification for calling memory use idiocy if you aren’t running out of memory.

It should be obvious that the people here aren't complaining about applications that take a trivial amount of memory. In 2021, nobody cares about a text editor that consumes 8 MB of memory. People are complaining about applications that do take up a significant amount of memory and cause you to run out.

Mozilla's Firefox hardware report[1] says that just under 25% of Firefox users have only 4 GB of installed RAM. If running on Windows, probably half of that is consumed by the operating system. Suddenly, a 400 MB Electron app is consuming a full fifth of your available memory. That's a real problem, especially for folks that either (1) don't have much money and can't afford a newer machine or (2) want to try to conserve the environment by not spuriously buying new hardware when the old stuff should work.

> As long as there is free memory in the system, it’s fair game, and does not represent inefficiency.

Maybe by your definition of "inefficiency". Most of the people in this thread are (apparently) using it to mean "using significantly more resources to provide functionality than are intrinsically necessary". This is a much more reasonable definition given that you don't actually know how many resources the user has.

[1] https://data.firefox.com/dashboard/hardware

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @04:17PM (#27596646)
> "Going slow* is using resources. Clock cycles are a resource.

This is not true for terminals, nor in general. You can, and terminals do, go slow without consuming more clock cycles. Latency in terminal rendering, not throughput, is the main reason for them feeling slow. In other words, delays in the system are the bottleneck, not compute.

https://danluu.com/term-latency/

> People are complaining about applications that do take up a significant amount of memory and cause you to run out.

People are complaining about memory usage without understanding why it's used or what it's being used for. Nobody yet has complained about running out of memory, I haven't seen any relevant discussion about virtual memory, memory compression, nor about what browsers actually do when they run low on memory. Turns out, surprise!, browsers can fit many more tabs than you think if you had blindly assumed that the amount of memory your process manager reports will scale linearly until you run out... that's not how it works.

Re:Your CPU may have slowed down on Wednesday by kaliszad on Tuesday June 22, 2021 @04:17PM (#27596636)
The point is, web is everywhere and nobody has to explicitly install anything to use a website - especially important for the less techy people that have no clue about "6 MMU wait states". So the browser is absolutely the right platform to build a (rich) text editor e.g. as a component of a web app. Is it an easy task? No, not really. We still have a half dead IE, Safari and the other browsers are far from perfect. Is that efficient? No. There is a ton of cruft and perhaps the best thing is to draw into a canvas and just not use most of it all (for better performance in the end). So you are basically pushing pixels from JavaScript (ok, or WebAssembly) in the end, if you want the best performance. Then you reimplement all the work that was already done at least 3 times before by OS, Browser and some library/ toolkit/ framework authors. You have to reimplement e.g translation using your own dictionaries, because you cannot easily work with the translator of the browser or the operating system (that's why browsers bring their own). You write a least a slightly different CSS for every browser family. You handle stuff like Content Security Policy differently. This is like every second thing, that you have to reimplement or make platform specific adjustments to make it work somewhat well. That's totally insane. In all this, absolute performance is just really hard to achieve. Do you expect people to ship apps for like 5 different platforms using perhaps 4 considerably different tech stacks or using 1 but then still adjusting for each platform again/ hacking it to look native and not get banned by an app store?

The problem is, people don't take responsibility for their work and almost nobody simplifies stuff. Stuff just somehow works but most of it just isn't solid or it isn't compatible or it is extremely (over)complicated. The next guy using it as a dependency has all these problems on top of the problems of his or her own with the problem at hand. This tree is multiple levels deep. Your pyramid is built on stuff that hundreds of smart engineers basically overlooked/ ignored for decades. Meltdown and friends is just one example, there are HW bugs, there are management engines, there is the OS, the libraries, other software/ daemons/ services, bad APIs, old APIs, deprecated APIs, functionality split between old and new API, bug ridden runtime, inconsistent behaviours of a markup language processing and styling implementation etc. pp.

We all need to get our act together and the harsh reality is, most of us just don't know everything and there isn't time to know everything. We need basic stuff to really just work and be as simple as possible given the problem domain, else we will not progress without gigantic investments.

Re:Your CPU may have slowed down on Wednesday by caeril on Tuesday June 22, 2021 @03:31PM (#27596094)
> Terminals aren’t using more resources

Right as I type this, gnome-terminal has 68MB allocated, of which 57MB is resident. My scrollback buffers are limited to 4096 lines and I have 7 tabs open, four of which are sitting on a bash prompt doing nothing. By ANY measure, this is absolutely insane.

> you don’t understand web browser allocation strategies

You may have missed my point. Rendering TEXT with a library intended to render gmail.com and facebook.com is a ludicrous extravagance.

> As long as there is free memory in the system, it’s fair game

This is my favorite argument. Just buy more ram, bro. CPUs are super smart bro, caches are magical and you'll always get a hit no matter how much you allocate or how fragmented your heap gets. YOLO.

Building software as if DDR4 is just as close to the ALU as L2, that our L2 is fully-associative, that branch prediction and cache hits on vtable dispatch is perfect, then spraying huge numbers of small objects all over the heap, and declaring that all you need to do is buy more RAM, and that halting your application for 6 MMU wait states every dozen cycles is perfectly acceptable.

Yes, waiting 20 billion cycles on an amdahl-adjusted basis to move a scrollbar is definitely the future.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @03:55PM (#27596382)
> My scrollback buffers are limited to 4096 lines and I have 7 tabs open, four of which are sitting on a bash prompt doing nothing. By ANY measure, this is absolutely insane.

Why? Is it using CPU while doing nothing? Scrollback might need at least 4096 lines * 7 tabs * 80 unicode chars =~ 5MB, conservatively. You have 7 child shell environments, and perhaps 7 large bitmaps cached for fast scrolling (I don't know what gnome-terminal caches for rendering, just guessing about what's possible). Plus the program code, the UI code, the terminal fonts. You haven't really explained why 60MB seems like too much to you, let alone "insane". It seems like you're just not accounting for all the features.

> Rendering TEXT with a library intended to render gmail.com and facebook.com is a ludicrous extravagance.

Why? Isn't it possible if the text rendering library were customized and smaller, that it would then consume more memory because it would be a 2nd library can't be shared with your HTML+CSS renderer, and you need those loaded too anyway?

The whole reason the library is big is because it does a lot of things. What reason is there for small/simple uses to not use a library that's already there?

> Yes, waiting 20 billion cycles on an amdahl-adjusted basis to move a scrollbar is definitely the future.

Your scrollbar takes multiple seconds to respond? Mine doesn't.

Your hyperbole notwithstanding, the reasons that browsers speculatively over-allocate is for caching - it is precisely because it's more efficient and performant that way. I didn't write Chrome, but I don't think what they've done is insane.

Re:Your CPU may have slowed down on Wednesday by miltondts on Tuesday June 22, 2021 @11:26AM (#27592877)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

Here is one concrete example: visual studio startup and debugging. Source: https://youtu.be/GC-0tCy4P1U

Maybe I could start collecting examples. I never did because it is so obvious. I mean, have you never updated android/iOS/windows on the same hardware?

Regarding the "exactly" part in you sentence. Why would more features equal less performance? The only possible reason I can see this happening, is if you have features that run in parallel. Otherwise it's just another callback/if etc. That is, something to be triggered by the user that should have imperceptible impact (slightly more pressure on the instruction cache) on the performance of other features.

Re:Your CPU may have slowed down on Wednesday by cogman10 on Tuesday June 22, 2021 @01:18PM (#27594382)
Pretty reminiscent of Grace Hopper's nanosecond lecture [1]

Certainly there are reasons why a feature might slow down a system beyond the branching (for example, if it requires you to load other resources)... but really, the issue is that as pointed out in the youtube video. Software companies very frequently do not care about performance.

[1] https://www.youtube.com/watch?v=9eyFDBPk4Yw

Re:Your CPU may have slowed down on Wednesday by shuntress on Tuesday June 22, 2021 @12:03PM (#27593387)
> Why would more features equal less performance?

"More features" can include things that were not feasible in the '90s. Things that inherently consume more resources.

Icons/images are a simple example.

Of course good software can get plenty done with 16x16 images. Good software may get all that done and more with access to more memory for higher resolution images and more CPU cycles for image manipulation.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @01:07PM (#27594250)
> Why would more features equal less performance? […] Otherwise it's just another callback/if etc.

Wait, really? Are you serious? Adding features historically is - by far - the single biggest cause of bloat and losing perf on a given fixed hardware configuration. I have no idea why you’re suggesting that unnamed “features” are “just another callback/if”. What features are you talking about, why are you assuming how they’re implemented?

I don’t think Visual Studio is representative of most software, nor a reasonable demonstration of your argument above against clean code practices. That said, I’ve been using Visual Studio for 20 years, and in my experience it’s significantly faster now to start up than it used to be. The functionality has also changed, so it’s not an example of functionality staying the same while resource usage increases.

Re:Your CPU may have slowed down on Wednesday by fouric on Tuesday June 22, 2021 @03:18PM (#27595919)
> Wait, really? Are you serious?

It should be pretty obvious that many features should have no perceptible performance impact if they're not actively being used.

> Adding features historically is - by far - the single biggest cause of bloat and losing perf on a given fixed hardware configuration.

If by "bloat" you mean binary size - nobody is complaining about that. If by "bloat" you mean idle CPU, UI latency, startup time - that's an engineering failure.

> I have no idea why you’re suggesting that unnamed “features” are “just another callback/if”.

Because that's true. Most features literally have no reason to use CPU if they're not being used. If Spotify adds a new "double-shuffle playlist" option, there is no valid reason that feature should use any CPU except when it's actually being used to shuffle things.

> What features are you talking about,

Most features? Take almost any program, start enumerating the features, and then start partitioning them by what resources they consume while not in use. Let's see, Google Chrome, downloads tracker. Is there a good reason for it to use CPU while you're not clicking a download link? Nope.

> why are you assuming how they’re implemented?

This entire thing is about bad implementations. If a particular implementation of a computationally cheap thing is inefficient, then that's a bad implementation, and it should be rewritten. Nobody is complaining that ML models take a long time to train, or that videos take a lot of CPU to be transcoded, because everyone knows that those things are intrinsically computationally expensive, regardless of how you implement them (although obviously the difference between a good and bad implementation can still shave off massive amounts of time and space).

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @06:35PM (#27598138)
You're presuming to speak for @miltondts, while contradicting what they said. The argument at the top of the thread was that good implementations are to blame for perf decay.

> It should be pretty obvious that many features should have no perceptible performance impact if they're not actively being used.

That's true, and irrelevant. It's also true that feature bloat is the number one cause of software slowing down. It doesn't have to be all or most features, it's still a fact.

I've lost track of your point. Software is bigger? I agree. Some software is bloated and uses resources it doesn't really need? I agree. You're arguing with everything I say, but don't seem to be trying to have a conversation or to understand or give any benefit of the doubt. Some of the things you're saying are true, I may not be disagreeing with you, a lot of this is just not relevant to either my points or the comments I replied to.

> Google Chrome, downloads tracker. Is there a good reason for it to use CPU while you're not clicking a download link? Nope.

Did you mean to include during downloads to refresh the page, or during scrolling and interaction with the page? I don't understand your example, have you seen the tracker consuming copious CPU? Does this example support your argument about engineering failures somehow? I opened my Chrome task manager just now and my downloads tracker is consuming exactly 0 cycles. Have you seen Spotify shuffle consuming CPU? If not, why did you bring it up?

> Most features literally have no reason to use CPU if they're not being used.

This is completely meaningless, until you name all features and all software, and define what "feature" means in all cases. You have no basis here to make any claims about "most features" of software.

Many features do have reasons to use resources. Caching is a feature that always uses memory when not in use, and caching is absolutely ubiquitous. Rendering is a feature that uses CPU even when the user isn't asking for anything. Speculative downloads, background processes, pre-computation, event driven callbacks, timers... the list of things ("features") your OS and browsers and applications intentionally do when you're not looking is very, very long. Claiming otherwise only demonstrates ignorance of what's under the hood. Naming a couple of cherry-picked features that don't use a lot of resources is not particularly compelling.

Re:Your CPU may have slowed down on Wednesday by fouric on Wednesday June 23, 2021 @10:22PM (#27613157)
> You're presuming to speak for @miltondts, while contradicting what they said.

I am presuming to speak for nobody except myself, by responding to your arguments.

> The argument at the top of the thread was that good implementations are to blame for perf decay.

I don't see that anywhere in the thread. If, by "good implementations", you mean "scalability, portability and clean code" - then you're wrong, because implementations that are highly inefficient are not "good", regardless if they're any of those other things too.

>> It should be pretty obvious that many features should have no perceptible performance impact if they're not actively being used.

> That's true, and irrelevant.

It's completely relevant, because the topic is "performance", and your argument is that the performance losses are caused by added features.

> It's also true that feature bloat is the number one cause of software slowing down. It doesn't have to be all or most features, it's still a fact.

...a claim which is so vague as to be unprovable, and for which you have provided absolutely no evidence whatsoever - so, no, it's not "still a fact".

Meanwhile, I can make any number of arguments from first principles as to why there's no good engineering reason why many of the added features of modern-day programs should cause the massive increase in used resources over their older equivalents.

I'm willing to bet that you cannot point out more than two or three features in Discord, Spotify, Teams, Atom, Slack, or other similarly bloated applications that actually necessitate their ridiculous resource consumption. As in, O(n) for space and time use. (hint: none of these programs are solving the traveling salesman problem)

> I've lost track of your point. Software is bigger? I agree. Some software is bloated and uses resources it doesn't really need? I agree.

Perhaps I should have stated my point more clearly: the main reason that modern programs are inefficient is because they're implemented with inefficient technologies, most relevantly Electron (and webtech more generally), and not because the added features that they bring are intrinsically computationally expensive.

> You're arguing with everything I say, but don't seem to be trying to have a conversation or to understand or give any benefit of the doubt.

A "debate" is different than a "conversation", and this isn't surprising. I'm not trying to have a conversation, I'm trying to debate points that you're making. Not everything can or should be a "conversation". Moreover, there's no "benefit of the doubt" to give - I'm not assuming that you're being malicious, I'm just asking for actual empirical evidence and/or argument from first principles - neither of which you're giving.

> Does this example support your argument about engineering failures somehow? I opened my Chrome task manager just now and my downloads tracker is consuming exactly 0 cycles. Have you seen Spotify shuffle consuming CPU? If not, why did you bring it up?

It should be pretty obvious that I brought those examples up to illustrate examples of features that should not use resources while not actively being used.

> Many features do have reasons to use resources. Caching is a feature that always uses memory when not in use, and caching is absolutely ubiquitous. Rendering is a feature that uses CPU even when the user isn't asking for anything. Speculative downloads, background processes, pre-computation, event driven callbacks, timers... the list of things ("features") your OS and browsers and applications intentionally do when you're not looking is very, very long.

None of these are "features" - these are all implementation details. A "feature" is the downloads page in Chrome, or the shuffle feature in Spotify.

> Naming a couple of cherry-picked features that don't use a lot of resources is not particularly compelling.

You haven't been able to name a single actual feature that has a technically valid reason to use significant resources simply by being added to a host program, let alone one that's relevant to the highly-inefficient applications that everyone throws around (Discord, Spotify, Teams, Atom, Slack). My features, while individual examples, are miles better than the literal nothing that you have provided.

And, for emphasis: I'm willing to bet that you cannot point out more than two or three features in Discord, Spotify, Teams, Atom, Slack, or other similarly bloated applications that actually necessitate their ridiculous resource consumption. As in, with big-O notation for space and time use. (hint: none of these programs are solving the traveling salesman problem)

Re:Your CPU may have slowed down on Wednesday by dahart on Thursday June 24, 2021 @12:44AM (#27614065)
> I'm not trying to have a conversation, I'm trying to debate

I can tell, please consider relaxing a little. I appreciate the time you put into responding to me, but FWIW your extra long reply is almost completely straw man from my point of view, and getting unnecessarily aggressive and hyperbolic now. I don’t need to debate this, because you’re not actually addressing my points, because you haven’t actually understood what I’ve said, because you’re trying so hard to debate. This conversation wouldn’t have gone down like this face to face, and as engineers there’s a pretty good change we’d agree. Good luck, TTFN.

Re:Your CPU may have slowed down on Wednesday by johndough on Tuesday June 22, 2021 @12:06PM (#27593429)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

Everything that uses NVIDIA drivers on Linux, e.g. through OpenGL. Just bringing up an empty window takes over a second these days, while it was <200ms just a few years ago, even with spinning metal disks instead of SSDs.

Re:Your CPU may have slowed down on Wednesday by normac2 on Tuesday June 22, 2021 @11:28AM (#27592907)
So the idea that performing the same daily tasks on modern hardware feels about the same speed as before (and sometimes slower), doesn't have a ring of truth to you?
Re:Your CPU may have slowed down on Wednesday by djur on Tuesday June 22, 2021 @11:42AM (#27593110)
No. Modern computers seem considerably faster to me than the ones I was using in the '90s and early '00s, especially computers that are 4-5 years old running recent software. I remember a lot of choppiness and spinning hourglasses which are much less common today.
Re:Your CPU may have slowed down on Wednesday by normac2 on Tuesday June 22, 2021 @12:33PM (#27593812)
That's how I remember the late 90's and early 2000's specifically, which I think was an especially dark age for the speed of the overall software + hardware combo. but if we go a bit more recent (say 2005 to today) I mostly haven't perceived a gain in speed.

That said, I think in the last very few years it's turned around a bit, mainly due to SSDs. In my experience most times that software is painfully slow (in any era) it's because you have too many things open and you're swapping. And SSDs provide acceptable speed even when swapping.

In other words, I find modern machines to be roughly as slow as ~2005, but only up to the very recent years when SSDs have become the norm. Now I'm starting to finally feel things being faster overall.

Re:Your CPU may have slowed down on Wednesday by randomswede on Wednesday June 23, 2021 @10:16AM (#27604802)
My daily-driver linux UI (fvwm something or other, whatever the fvwm that comes with Debian 10) is noticeably slower than my daily-driver linux UI as per 1997-2002 (gwm). Which is somewhat ironic, as gwm was basically an interpreter with a bunch of built-in X11 manipulation primitives.

But, back then, getting the "desktop context menu" up too approximately no perceivable time, whereas these days I notice time passing. I don't think that is because my reflexes have improved massively in the last 20 years.

Re:Your CPU may have slowed down on Wednesday by loonster on Tuesday June 22, 2021 @12:29PM (#27593740)
We have SSDs now. That alone made a huge improvement.
Re:Your CPU may have slowed down on Wednesday by seniorThrowaway on Tuesday June 22, 2021 @12:42PM (#27593953)
>Localization didn’t exist, web analytics wasn’t really a thing, browsers didn’t run background tasks.

Maybe the question to ask is how much of this is to the benefit of the end user versus building ever more sophisticated adtech.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @01:16PM (#27594349)
I think localization & background tasks are more or less 100% to the benefit of the end user. Web analytics was just an example of more functionality that goes unnoticed because it’s not hurting performance. I’d agree analytics is building more adtech, though I feel like that’s a cynical glass-half-empty framing. Analytics have also helped huge numbers of sites to improve UX by understanding how users behave and where they get tripped up.
Re:Your CPU may have slowed down on Wednesday by mdoms on Tuesday June 22, 2021 @03:19PM (#27595929)
We don't even need to look 20 years in the past. Software performance has degraded significantly in just the past handful of years. Compare web applications like Facebook, Jira, Twitter and Reddit to the exact same websites 5-7 years ago. They have all implemented horrendously over-engineered, buggy and most importantly dog-slow single page apps to offer the same basic service.
Re:Your CPU may have slowed down on Wednesday by fouric on Tuesday June 22, 2021 @02:52PM (#27595586)
> Which software exactly is functionally the same yet consumes more resources?

This is irrelevant, as it's extremely difficult to find any two pieces of software that are "functionally the same", regardless of their age of release or performance - and, moreover, because we're programmers, we can make informed estimates about the minimum performance impact of most features without just guessing.

For instance, string localization should have no perceptible performance impact - it's literally just a key-value lookup (O(1) with a hash table). The additional features that Spotify provides over Audacious (a local Linux music player) are either not intrinsically computationally expensive (fetching audio over a network) or are done server-side (playlist recommendation). Discord has no technically valid reason to be taking up 15% of a CPU core while sitting in the background. And so on.

> Today 4K is normal, and combined with refresh rates and colors, we’re pushing upwards of 2 orders of magnitude more data to our screens.

We have GPUs that now do all of our graphics rendering work for us. The features implemented by Spotify, Slack, Discord, and Visual Studio Code do not intrinsically require enough graphical resources that they should stress even an older integrated GPU, let alone take 5 seconds to start up on CPU and RAM that are, similarly, one to two decimal orders of magnitude faster than what we had two decades ago.

> YouTube and Netflix didn’t exist 20 years ago. Browsers were incredibly slow and couldn’t support streaming video or anything but the smallest of applications written in JavaScript. Localization didn’t exist, web analytics wasn’t really a thing, browsers didn’t run background tasks.

None of this is relevant to applications. Browsers were slow back then? Fine. Browsers are faster now? Also fine. That's still irrelevant to the fact that many applications are slower now, on much faster hardware, than they were then.

Re:Your CPU may have slowed down on Wednesday by dahart on Tuesday June 22, 2021 @03:33PM (#27596123)
> This is irrelevant, as it's extremely difficult to find any two pieces of software that are "functionally the same"

Yes, indeed. You're illustrating is why the post I replied to is a straw man argument. Most software, as you say, is not functionally the same anymore.

> string localization should have no perceptible performance impact

Yes, my argument was that we got localization without a noticeable perf impact. But it does consume memory, bandwidth and code size, and as you correctly point out, a small amount of compute. I would venture to suggest that rendering Asian fonts is a tad more involved than an O(1) hash table lookup. Localization is just one of hundreds of features we have standard now that we didn't have 20 years ago.

Re:Your CPU may have slowed down on Wednesday by mirker on Tuesday June 22, 2021 @10:41AM (#27592262)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

Operating systems, particularly Windows. Given fixed hardware, you cannot expect an operating system to continue working indefinitely.

Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @12:29PM (#27593752)
Windows is not functionally the same between branded versions. Even if the NT kernel was shared across some branded versions over time, for example, new features were added and underlying functionality were changed.
Re:Your CPU may have slowed down on Wednesday by mirker on Tuesday June 22, 2021 @01:28PM (#27594497)
The question is how much those features were worth in terms of cost (is a feature bloat?). If you don’t have a cost constraint, then yes, you have feature diversity but the cost for any feature can be arbitrarily high.
Re:Your CPU may have slowed down on Wednesday by moonbug on Tuesday June 22, 2021 @11:32AM (#27592965)
Whyever not.
Re:Your CPU may have slowed down on Wednesday by mirker on Tuesday June 22, 2021 @11:43AM (#27593131)
Windows 95 needed 4MB memory. Windows 7 needed 1GB. Try running Windows 10 with less than 4GB.

They all run processes, do they not?

Re:Your CPU may have slowed down on Wednesday by badsectoracula on Tuesday June 22, 2021 @06:05PM (#27597820)
> Which software exactly is functionally the same yet consumes more resources? Can you give some specific examples?

Instant messaging. Even if we ignore applications like the original MSN Messenger, Trillian, etc, the original Skype before Microsoft's acquisition was much faster. Sure, it wasn't as fast as it could be - but still didn't had an entire browser wrapped around it nor needed checks 350MB of RAM and 7 background processes just to display an icon on the tray so i can send text messages and perhaps the occasional video call once every two years.

And to be honest? I do not really find it that weird if a program needed some extra resources to make a video call - which is why LoadLibrary and (especially) FreeLibrary exist. But in practice that is never done or when it is done it is piled on top of an overengineered system to the point where it loses any benefits under the weight of the architecture astromancy.

> if you don’t know or don’t pay attention what’s under the covers.

Or don't care.

Don't forget the don't care part! It is very important because a lot of the bloat is presented as "functionality" (which, assuming most people even care - and that assuming they'd know what they "pay" for it - often doesn't even need to be as heavy and bloated as it is).

> One easy to overlook difference is displays.

Aside from resolution, physical dimensions and thinness, displays are worse nowadays. Compared to CRTs they have bad contrast, often bad colors, increased latency (even the ultra-fast 144Hz+ ones), a fixed resolution with awful results if you try to use anything but the native, etc. Note that i'm writing this from a 165Hz 27" 2560x1440 monitor BTW with a few CRTs next to me connected on older systems. And BTW

> It’s easy to forget that 20 years ago we had 800x600 screens, 24 bit color was not ubiquitous, and 60hz monitors were practically non-existent.

That'd be 30 years ago, not 20. 20 years ago was the year 2001 :-P. While 800x600 was indeed common, it was pretty much as common as 1024x768. And monitors at 60Hz were not common because those would hurt your eyes - even standard VGA released in the 80s runs at 70Hz. But by 2001 pretty much every monitor was able of 85Hz and several went much higher (e.g. 120Hz for mine).

> Today 4K is normal

4K is a tiny minority that is barely a blip in statistics. Here, check this:

https://data.firefox.com/dashboard/hardware

This is Firefox's hardware statistics. The most common resolution, by far, is 1920x1080. The next most common? 1366x768! Both make about 64% of every web capable computer out there! And the resolutions after that are actually lower than 1920x1080 until you reach at around 2% for 2560x1440.

Even among games where 4K has meme status, in Steam Hardware Survey you can see that only around 2.44% have a 4K monitor. There are more than three times more gamers using monitors less than 1080p that aren't 1366x768 or 1360x768!

There will be several years before 4K becomes a normal on the desktop. Right now it makes way more sense to think about something like 1366x768 than 4K.

Re:Your CPU may have slowed down on Wednesday by heurisko on Tuesday June 22, 2021 @07:43AM (#27590452)
> A world where some websites still don't work properly across web browsers.

The situation today is vastly better than in the days of IE6.

> A world where clean code destroys performance

Clean code does not mean code that is not performant.

In my mind, "clean code" is foremost small methods that do one thing, and are well-described. These small methods will often be optimised away, in the unlikely situation where they were the bottleneck in the first place.

In my experience messy code "for performance" reasons was usually code that had claims to being "fast", but was often incorrect and hard to fix.

Re:Your CPU may have slowed down on Wednesday by elvischidera on Tuesday June 22, 2021 @08:39AM (#27590891)
It could be OP is referring to multiple layers of (unnecessary) abstraction.

In Android land for example, there is a popular "clean" 3 layer architecture, where model classes are blindly mapped multiple times (even in cases where this is suboptimal).

I have lost count of people building "clean" inefficient caching mechanism instead of just using an HTTP cache.

Side note:

I believe these things are useful in some situations. Maybe the solution is to have a smart compiler that compiles out these inefficiencies?

Some (most?) apps are just skins around a database. Amazing what Facebook did with Messenger rewrite [0]

Is there an incentive problem? Generally, people get bonuses/accolades for making a slow system fast, not for keeping a system consistently fast. I admit the former is easier to measure.

0 - https://engineering.fb.com/2020/03/02/data-infrastructure/me...

Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @09:19AM (#27591224)
Maybe it's my bias but I took "clean code" not in the traditional sense, but to mean insisting on patterns perceived to be "pure" or "clean" even when their application harms performance or isn't a great fit for the host language (ahem, JavaScript and functional + immutable-datastructure programming) and makes it even easier for devs to footgun into bad performance while staying "pure".
Re:Your CPU may have slowed down on Wednesday by miltondts on Tuesday June 22, 2021 @09:48AM (#27591565)
Yes, I should have typed "clean code". It's exactly what you and also what the parent said. It's about patterns/architectures/abstractions that we consider to be good/beautiful, but with very little regard for performance ("just throw more or better hardware at it, that is not our problem"). What really rubs the salt on the wound, is that the people that advocate them are quite loud, they seem to be growing in numbers and there is a massive lack of evidence for the supposed benefits, while the drawbacks are clear and easy to measure.
Re:Your CPU may have slowed down on Wednesday by inamiyar on Tuesday June 22, 2021 @09:47AM (#27591559)
I don't think that's what they meant but it's a good point! I've seen embedded developers write some...truly terrifying code though.
Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @12:34PM (#27593818)
Function purity is a mathematical term with a clear definition and doesn’t deserve the double quotes which imply some vacuous definition or uncertainty.

Assuming you are referring to “pure”, in the context of functional programming and isolation of side effects.

Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @12:42PM (#27593952)
Was what I was referring to actually ambiguous?
Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @01:44PM (#27594722)
What is ambiguous are the details about how you think that JavaScript and functional + immutable-datastructure programming is detrimental.
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @01:49PM (#27594779)
Oh, that's totally different from what you posted about before. OK.

Allow me to quote me, to clarify this part, then.

"when [they aren't] a great fit for the host language"

Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @02:51PM (#27595578)
What remains ambiguous is how it is not a great fit, in that specific case.
Re:Your CPU may have slowed down on Wednesday by heurisko on Tuesday June 22, 2021 @10:01AM (#27591716)
If the OP meant "multiple layers of unnecessary abstraction" I would agree with them.

However "clean code" connotes to me the techniques advocated in "Clean Code" by Robert C. Martin, which amongst other things, advocates small descriptive functions.

Re:Your CPU may have slowed down on Wednesday by shuntress on Tuesday June 22, 2021 @12:10PM (#27593483)
> Maybe the solution is to have a smart compiler that compiles out these inefficiencies?

Compilers are software. A "smarter" compiler is probably going to consume more resources.

Re:Your CPU may have slowed down on Wednesday by elvischidera on Tuesday June 22, 2021 @01:47PM (#27594758)
True. But at least it happens for each compile per developer which is a far smaller number than for each use per end-user.
Re:Your CPU may have slowed down on Wednesday by ajconway on Tuesday June 22, 2021 @08:26AM (#27590777)
> In many cases, this software doesn't even do anything that is functionally different from 10 or 20 years ago, but it still consumes many more resources

I would argue that in most cases the choice is not between fast, optimized and slow, unoptimized software. The choice is between having a functioning program (using a universal, "reasonably" efficient stack) and not having one at all (because the amount of resources it takes to develop a customized, low-level implementation is prohibitively high).

A good example: https://www.youtube.com/watch?v=tInaI3pU19Y A custom 3D engine performs immensely better than a comparable Unity project, but it took the author 3 to 4 times the effort.

Re:Your CPU may have slowed down on Wednesday by thrwaeasddsaf on Tuesday June 22, 2021 @07:47AM (#27590470)
> Yeah, all this concern with scalability, portability and clean code, has created quite a dystopian software world.

I don't see it having anything to do with scalability, portability, or clean code.

It's just cheap and (for the developers) convenient. Developers think that their software is a gift to the world, and simply getting it made (not matter how cheaply and craply and user-hostilely) is a net positive. (I wonder how many people use all these bloated things only because they pretty much have to, due to peer pressure, company requirements, etc.)

It is possible to make software that scales, is clean, portable, and doesn't rely on massive bloat.

Re:Your CPU may have slowed down on Wednesday by thereddaikon on Tuesday June 22, 2021 @08:59AM (#27591043)
I think scalability, portability and cleanliness is mostly talk. The reality is that browser based frameworks like Electron are popular because developers who only know js are cheaper and the first half of the lifecycle is cheaper and faster while the second half is often either dropped entirely or someone else's problem.

Of course a JIT compiler will never be as performant as precompiled binaries, especially when its running in a full featured web browser that is packing functions that the developer neither needs nor is using.

Re:Your CPU may have slowed down on Wednesday by spamizbad on Tuesday June 22, 2021 @11:51AM (#27593224)
I'm not convinced React Native developers are cheaper than C/C++ developers. At my last job, the Python and C++ devs were on identical salary bands.
Re:Your CPU may have slowed down on Wednesday by postalrat on Tuesday June 22, 2021 @09:09AM (#27591115)
The reason electron took off if because it was the first to offer an easy way to build cross platform apps. Something the systems guys have failed to deliver for many years.
Re:Your CPU may have slowed down on Wednesday by citrusybread on Tuesday June 22, 2021 @10:55AM (#27592450)
Qt, wxWidgets, hell even Java's UI toolkits were all cross-platform long before Electron crawled out of the swamp.

Even GTK is cross platform!

Re:Your CPU may have slowed down on Wednesday by brigandish on Tuesday June 22, 2021 @11:26AM (#27592863)
> an easy way

That's the key phrase, and it means easy way for front end web devs, those who have forced the entire toolchain to dance to Javascript's tune because everything would be easier if we had one language to rule them all.

Re:Your CPU may have slowed down on Wednesday by tshaddox on Tuesday June 22, 2021 @12:00PM (#27593356)
What’s the easy way to build cross-platform GUIs for people who aren’t frontend web devs?
Re:Your CPU may have slowed down on Wednesday by brigandish on Tuesday June 22, 2021 @10:46PM (#27600228)
There are plenty of mature cross platform GUI frameworks to choose from, they're not going to go away. Pick one, and like any other framework, if you stick with it you will soon find it easier than using something else.

Even Zig has Qt bindings[1] and that's still enough of a hot young thing to regularly reach HN's front page, so it's likely that other popular languages that are older have bindings, no need to devolve to using something JS devs crave. There's wxWidgets[2] or Shoes (I loved using Shoes, thanks _why!) and many more[3].

[1] https://wiki.qt.io/Language_Bindings

[2] https://en.wikipedia.org/wiki/List_of_language_bindings_for_...

[3] https://en.wikipedia.org/wiki/List_of_widget_toolkits

Re:Your CPU may have slowed down on Wednesday by iforgotpassword on Tuesday June 22, 2021 @01:48PM (#27594771)
Build n native apps, make them look the same and pretend it's cross platform. :-)
Re:Your CPU may have slowed down on Wednesday by CyberDildonics on Tuesday June 22, 2021 @03:31PM (#27596087)
I've seen people say stuff like this before. Do you actually not realize there have been cross platform GUI libraries for the last thirty years?
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @09:42AM (#27591496)
There are tons of easy ways to build cross-platform apps, and have been for a long time. Extreme, very free-form customization of GUI elements so it looks & behaves exactly the way your marketing, branding, & web-design folks want down to the pixel on every platform, is what was hard before Electron. If you just wanted to deliver a GUI applications cross-platform, full stop, that's not something you couldn't do before, fairly easily, especially if Electron's performance and integration with its host platform is considered acceptable for what you're doing.
Re:Your CPU may have slowed down on Wednesday by postalrat on Tuesday June 22, 2021 @09:54AM (#27591634)
What alternatives? How many of them include the web as a platform?
Re:Your CPU may have slowed down on Wednesday by CyberDildonics on Tuesday June 22, 2021 @01:19PM (#27594397)
Now you are moving the goal posts to "web as a platform". Web as a platform is not what you originally said and "web as a platform" is done well with web pages.

People talk about electron being 'the only way to create cross platform apps' and ignore fltk, juce, qt, gtk, wxWidgets, tk and a whole host of other solutions, not to mention making a local webserver, opengl guis etc.

When someone only knows javascript they might want to work with electron, but no one who is going to use that software wishes it was made in electron. That's the bottom line, people don't want it, it is a selfish decision that creates terrible interactivity and grossly bloated software.

Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @01:40PM (#27594677)
I'm 100% convinced the appeal of Electron is that it makes chasing the latest UI trends month-to-month as easy on the desktop as it is on the web. Designers and businesses (and lots of developers) consider this essential, these days, for whatever reason. The above (yes, including the business side) will all complain about how a real desktop program using built-in or otherwise sane-and-stable GUI elements that haven't changed for 5 years looks too "old".
Re:Your CPU may have slowed down on Wednesday by postalrat on Tuesday June 22, 2021 @09:23PM (#27599620)
How many popular desktop apps use anything resembling native GUI elements?

Not browsers, not photo editors, not games, not many chat applications. Certainly there must be some big ones that do right?

Re:Your CPU may have slowed down on Wednesday by CyberDildonics on Tuesday June 22, 2021 @10:14PM (#27600016)
Now you are moving the goal posts again from 'no other way to do cross platform apps' to 'what uses native GUI elements'.

The dozen cross platform libraries that have been around for multiple decades are all 100 times faster than the electron, that's the point.

Re:Your CPU may have slowed down on Wednesday by postalrat on Tuesday June 22, 2021 @11:31PM (#27600483)
I didn't move any goal posts. Here I'm responding to a different comment. This time regarding gui elements and user experience.
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @10:13AM (#27591858)
Java and its various GUI toolkits (again, especially if Electron's performance isn't bad enough that it's off the table). QT. TK. Wx. Delphi and some others if you didn't mind paying.

Obviously none of them include the Web as a platform (unless you count Java applets, which you shouldn't since they're basically dead, even if they'd seem high-performance and quite nice compared to what we've replaced them with).

Re:Your CPU may have slowed down on Wednesday by tshaddox on Tuesday June 22, 2021 @12:02PM (#27593370)
Why is that obvious? The only thing that’s obvious to me is that if these cross-platform GUI frameworks don’t support the web then almost no one who needs to build a cross-platform GUI will have any use for them.
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @12:40PM (#27593902)
Because I was responding to "The reason electron took off if because it was the first to offer an easy way to build cross platform apps".

If you're defining "cross platform" as, strictly, "the Web", then I'm not really sure what kind of exchange you're trying to have or what you're trying to add, here. Obviously only the web satisfies the criterion of being the web. Which makes me wonder even more why you didn't find that obvious.

Re:Your CPU may have slowed down on Wednesday by tshaddox on Tuesday June 22, 2021 @12:56PM (#27594116)
I'm certainly not trying to define "cross-platform" to mean "the web." I'm just pointing out that the web is a huge platform and for many use cases is arguably the most platform for a cross-platform GUI framework to support.
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @01:36PM (#27594622)
"Webtech's (Electron, specifically) the only reason cross-platform desktop GUI programs are now cheap & easy enough to be viable"

"Well, no, we've had that for a long time, especially if you consider the performance compromises of Electron or in-browser 'apps' to exist within the acceptable range. Electron does make mimicking this year's UI trends as easy on the desktop as on the Web, and doing so on every platform at once, and that was hard before."

"Right, but do those earlier solutions support the web as a platform?"

"... huh?"

See why I'm confused about where you're taking this? It's like someone claimed that airplanes were the only way to travel by machine, and I pointed out that, for one thing, trains existed before that, and now you're asking me if trains can fly. No—and, again, obviously so unless we've got some seriously different life experience, here—but that's... a complete non-sequitur to the conversation already in progress.

Re:Your CPU may have slowed down on Wednesday by tshaddox on Tuesday June 22, 2021 @02:01PM (#27594939)
I think you’re conflating two very different things.

The first thing is using web technology to build apps that are distributed as native apps on many platforms (which works because there are open source web browser engines that already support most computer platforms). This is what Electron is.

The second thing is for any cross-platform framework to support targeting the web, because the web is itself a very huge platform. This is important, because not all platforms and situations support installing native apps. If you want your cross-platform app to work on web browsers, you need your cross-platform app to support targeting the web. This might be important if you want your app to work in computer labs, for example.

Re:Your CPU may have slowed down on Wednesday by thereddaikon on Tuesday June 22, 2021 @01:25PM (#27594476)
Why does "the web" have to be a targeted platform? It isn't one in reality, Chromium, Safari and Firefox are different enough that you have to target them specifically.

Seems to me the desire for having "web" as a platform isn't so you can also support a browser application. Its so you can make it a web app and call the job done.

Re:Your CPU may have slowed down on Wednesday by kortex on Tuesday June 22, 2021 @07:04AM (#27590166)
So what do we do about it? Even if Electron doesn't give feature parity across OSes, it still has some other huge wins. It allows you to use "webdev" talent to build guis, which are (I presume) easier to hire. They can use their favorite frameworks. It seems like SPA-esque-apps have some agility in development over other native approaches. It makes updates, CI/CD, and testing easier.

Even if not prioritizing cross-platform, Electron has some serious appeal.

What are my alternatives? Qt? Gtk? Native libraries?

Re:Your CPU may have slowed down on Wednesday by danmur on Tuesday June 22, 2021 @07:33AM (#27590374)
It's a shame that cross-platform GUI toolkits seem to have fallen out of favour somewhat (as in, native toolkits like Qt or GTK). I wish it were not so. I can see why the electron route is so tempting, I just really hate them as a user.

I wrote a bunch of GTK desktop apps with Python like 15 years ago and they were snappy and you'd never even know it was Python behind it, but I wouldn't do that now. Too hard to distribute, bindings a bit clunky, lots more cross-platform testing, it's hard to look at the relative levels of effort and not take the faster path.

Re:Your CPU may have slowed down on Wednesday by jschwartzi on Tuesday June 22, 2021 @10:14AM (#27591871)
A Qt install with all the bells and whistles is about 500 megabytes, so it’s very comparable in size to Electron. Qml is a lot easier to develop in than Node+browser though.
Re:Your CPU may have slowed down on Wednesday by thereddaikon on Tuesday June 22, 2021 @01:32PM (#27594563)
Size on disk isn't, or shouldn't be a problem today. In an ecosystem where there are games that take up over 100 gigabytes of storage, few apps should be large enough to make a user double take. CPU and Memory usage on the other hand can be serious concerns and one where Electron apps have a serious problem compared to traditional approaches.
Re:Your CPU may have slowed down on Wednesday by beowulfey on Tuesday June 22, 2021 @08:17AM (#27590703)
I’m not one with much experience, but I rewrote my Qt based code for a small python app into C++ and the results were amazingly better. I would bet GTK might be similar!
Re:Your CPU may have slowed down on Wednesday by api on Tuesday June 22, 2021 @09:26AM (#27591290)
Qt is pretty good, but honestly since React came out I can't code a GUI in any other way. Reactive is the way to do (application) GUIs, period, and anything else feels like clunky bug-prone spaghetti.

I put application in parentheses because other paradigms may make sense for high performance rendering pipes like games.

Honestly I don't think HTML5/CSS/JS is that bad as a pure presentation layer. It has warts as they all do, but it can be made to look decent and is fairly productive. The bloat is mostly the fault of Electron specifically. Tauri and Sciter are much leaner, in some cases leaner than Qt depending on the app.

Re:Your CPU may have slowed down on Wednesday by Wowfunhappy on Tuesday June 22, 2021 @07:13AM (#27590222)
> What are my alternatives? Qt? Gtk? Native libraries?

I don't know what the development side is like, but as a user I do find Qt apps to be fairly nice.

I also think Java (Swing) apps are basically fine. Java was "bloated" back in the day, but not relative to what else is in use today.

Re:Your CPU may have slowed down on Wednesday by kortex on Tuesday June 22, 2021 @07:19AM (#27590258)
Hm, Jvm also gives access to Kotlin and Scala, I'll definitely have to look into it.

Qt development can be excellent or nightmarish, sometimes both. I don't know enough to know why the disparity but I've been adjacent to teams that love qt and ones that loathe it. I'm guessing a big aspect is state management; qt predates the reactive revolution, and IIRC is prone (as is any gui) to callback hell.

Re:Your CPU may have slowed down on Wednesday by ensiferum on Tuesday June 22, 2021 @09:40AM (#27591470)
Overall Qt is quite nice and works portably across platforms. You're right about callback hell but there's a fox for it. Personally I prefer to create a bunch of overloaded utility functions for different widgets and data types and in each utility function i use QSignalBlocker to make sure I'm not accidentally invoking any callbacks. I condiser any "raw" Qt "setXYZ" call to be a bug.
Re:Your CPU may have slowed down on Wednesday by kortex on Wednesday June 23, 2021 @08:39AM (#27603778)
Huh, neat. What's a "fox" in this context? I tried searching "qt fox" and got some, ahem, less than salient results.
Re:Your CPU may have slowed down on Wednesday by krylon on Wednesday June 23, 2021 @10:03AM (#27604681)
Typo for "fix" would be my guess.
Re:Your CPU may have slowed down on Wednesday by danmur on Tuesday June 22, 2021 @07:34AM (#27590384)
Just as a fun test a while ago I made a small desktop app with scala and scalafx/javafx. It's not bad, gives you some of the nice things you get from js guis (reactive rather than loads of callbacks etc).
Re:Your CPU may have slowed down on Wednesday by the__alchemist on Tuesday June 22, 2021 @10:36AM (#27592188)
> What are my alternatives? Qt? Gtk? Native libraries?

Yes. You are not a Javascript Programmer, or a Frontend Programmer; Choose the right tool for each job.

Re:Your CPU may have slowed down on Wednesday by slumdev on Tuesday June 22, 2021 @09:30AM (#27591352)
> Yeah, all this concern with scalability, portability and clean code, has created quite a dystopian software world.

I don't think scalability, portability, and clean code are the enemy.

C/C++ are as portable as they ever were, and Java/.NET provide higher-level abstractions that work across both Windows and *nix systems. Even Electron doesn't have to suck, in theory.

The reason performance is bad these days is because developers are just bad. The number of developers doubles every five years. Ergo, half of all developers have less than five years of experience. The vast majority of them don't have a CS, CE, or EE degree. A large number of them went through bootcamps (which are an expensive version of the old "Learn VB in 21 Days!" books.) And they're all writing the Electron apps we love to hate.

Re:Your CPU may have slowed down on Wednesday by staticassertion on Tuesday June 22, 2021 @11:48AM (#27593187)
As a college drop out I'm pretty sure I know more about writing efficient code than most CS grads - I've seen what gets taught, it's not impressive. I've also seen bootcamps (haven't attended, but friends have) and while they don't teach about efficiency, they're far more rigorous than college was. Anyway, I don't want to get into this really, but I found this part of your post to be annoyingly off-base, and I resent it.

That said, I'm in agreement that most devs don't know much at all about performance. Frankly, we're told not to... it's a sad state. Performance is explicitly referred to as a last priority, the "optimization is the root of all evil" quote is completely taken out of context and parroted everywhere (go look up Knuth/Hoare's context if you haven't), etc.

All that is to say, the issue is not specific to education but is an unfortunate part of engineering culture. We, as a large group, explicitly neglect performance and treat it as a dirty word.

IMO we need a sort of performance revolution the way testing got one. I've written lots of software in a 'benchmark driven' way, and the results are extremely fast programs - I've gotten programs down from just under 1ms to a few dozen nanoseconds like that.

Re:Your CPU may have slowed down on Wednesday by ensiferum on Tuesday June 22, 2021 @09:42AM (#27591494)
I think it's the growth in data that when combined with accidentally bad algos suddenly start to drag down the perf.
Re:Your CPU may have slowed down on Wednesday by einpoklum on Tuesday June 22, 2021 @02:56PM (#27595651)
> Yeah, all this concern with scalability, portability and clean code, has created quite a dystopian software world.

All of these three - when interpreted reasonably - coincide and even constitute performance improvements:

* You make less assumptions, including regarding the speed of things, when you make your code portable.

* When your code is clean, it's easier to generalize speed benefits rather than when you need to apply some ugly spaghetti hand-written optimization in 20 places.

* Scalability means scaling up, out but also _down_ from the machine you're currently using. How else would you run your, say, distributed search web app on, say, a cluster of RPi 0's?

... Of course, if your approach to scalability and portability is to stick things in a container or vm, and manage a fleet of those, then yeah, that's kind of a problem.

Re:Your CPU may have slowed down on Wednesday by supernovae on Tuesday June 22, 2021 @12:03PM (#27593388)
This isn't a problem of clean code and software, its a problem of walled gardens.