Your CPU may have slowed down on Wednesday
travisdowns.github.io
travisdowns.github.io
But I do think software engineers should agree that updates should always be reversible. And security updates should always be backported yet still reversible.
This means getting security updates without feature updates, doesn't it? But this time we want feature updates without a security update.
[1] https://www.phoronix.com/scan.php?page=news_item&px=Spectre-....
mitigations=off works at the OS kernel level to patch out some expensive aspects of what the kernel can do (possibly in concert with the CPU but driven by the kernel). This issue a microcode change that affects the CPU behavior without any intervention by the kernel, so mitigations=off doesn't help.
It is purely a microcode fix for an "old-school" data dependent timing issue.
I know this way of disabling mitigations on Linux (nevertheless thank you, I well might be unaware of this feature, I only learnt it some years ago).
However, I doubt you can disable microcode-level mitigations this way. I believe it only affects the kernel level.
[0] https://wiki.archlinux.org/title/Microcode#Early_loading
No. If it wasn't impossible, it would add a massive delay to context switches between processes as the required microcode changes are applied.
My gaming PC, a Sandy Bridge i7-2600k, has had 20 microcode updates between 2010 to 2019. The majority were in 2013 until the spectre mitigations came in 2018. The last bios update for my mobo contains microcode 2 versions behind the spectre updates.
Feed a BIOS image in to this tool to view microcode information. https://github.com/platomav/MCExtractor
This is not as sure a deduction as it once was.
The main reason for games not to be playable on Linux is the anticheat software used in modern online games. Pretty much everything else will now run perfectly (see protondb.com). Since the commentor you were replying to specified that they played old single player games they would probably be fine with just Linux. Indeed many sufficiently old Windows games are now easier to play on Linux than they are on modern Windows.
The Linux kernel mitigations can be disabled easily. But with microcode this is the problem with having it as an opaque blob. You have no idea what's in that update. Maybe it's good for you, maybe it's bad.
I have to replace my computer every several years due to performance degradation, even though my workflow has remained the same for over a decade. Even editing simple text documents has become painfully slow on my 2013 Macbook Pro.
M1 gives me a few years breathing space, hopefully, but I'm sure it won't be able to open a 1KB text file instantaneously in 5 years.
However, on my beefy i9 work laptop I need to use Microsoft Teams and also Docker, which means the fan is on half the time and the computer can barely keep up with the workload.
I've seriously considering asking for another computer just to run Teams.
The solution I've settled on however is to just reject contracts where terrible software is mandatory unless there's a significant financial upside.
For Linux hosts NoMachine is really fast and can make use of stuff like x265 streaming. The open source x2go although slower can publish applications terminal services style in a way that the remote app window looks like its running on the local machine.
The fun part is that I could be using my personal stone-age 2GB/i3 MB Air if I were doing only development and e-mail.
I used to use an iPad for email, calendar and Jira. Maybe I should go back to it!
I wish I could use Windows XP with up-to-date hardware support and security updates, too. I remember the days of requiring on 300MHz core, 64MB of ram and 1GB of hard disk for the same functionality that Win10 now provides in a worse way.
works wonderfully and is very fast!
You read complaints on HN all the time that sure make it seem like we have entered a Malaise Era in computing. Us developers surely do not run computers set up like the average consumer, and you can be darn sure that corporate executives at Microsoft and Apple do not get plain vanilla laptops fresh off the production line.
The result is entirely predictable.
One of my college internships involved setting up laptops for VIPs and Executives for exactly these reasons! We optimized the installs, removed crud ware, and setup the system to be as well performing as possible, then shipped them out.
At one point Lenovo made a laptop where they cut costs by removing the cache on the HDD, there was nothing we could do to make that machine not horrible. Multiple minutes to do simple tasks, installing Office took hours! It was horrible, their reputation was so bad a number of them came back to us not even having been opened.
Unless you decide to switch to a modern console-based text editor. It doesn't have to be vim or emacs. There are many other alternatives. One new such (written-in-Rust) editor being Iota: https://github.com/gchp/iota
Usually I just go for Vim, but sometimes I need something else and in those cases I want to avoid heavyweights like VS Code.
But it won't work now, because the whole stack is probably too inefficient.
Ecology.
A lot of the older computers were awfully power-inefficient (and also emit a lot of heat).
So IMO we should replace "Pentium 4" in your statement with something like "Celeron J4115", or some of the Atom CPUs, maybe?
If I am to gauge my app's speed on an anemic hardware I'd prefer running it on a modern Atom or Celeron because (a) indeed they're anemic but (b) at least are more eco-friendly.
On this lane of thought, I'd say better to buy a laptop today (that's much greener than everything before it) that you can hold on to for 10+ years than holding on to another that has long passed its expiration date. But I am aware that this is not always a popular opinion.
I was simply mentioning that the machines get manufactured anyway so I definitely refuse to be guilt-tripped into "it's your fault that those machines exist!" extremist stance. No, it's not my fault. The machines are manufactured regardless of what I do so every 7-8 years I evaluate the market and upgrade.
Reasons are simple -- most modern software gets slower all the time and I still need to work and support my family. I would hold onto my machines for a lifetime but it's not the reality we live in and I wish the downvoters stopped being so tunnel-visioned and were aware of that.
Agreed. A base MacBook Pro isn't nearly powerful enough for all 3 of those at once.
Same goes for power. They're not going to burn one less lump of coal because your laptop uses 100W instead of 300W
Even when we collectively manage to reduce our energy usage they'll likely divert the extra energy to another power substation for storage and redundancy.
So don't think that me and others are defeatist. It's just that the entire grid is well planned for so that any difference we can make, even as 100_000 people, is still not as big. So this whole thing will take a while, likely decades.
In the meantime I was very happy when I replaced a fridge with 43kW monthly expense with a 19kW one, about two years ago.
That's not how it works. On the electric grid, generation must always be precisely matched with consumption, otherwise things can literally burn up. Any excess of generation will cause an increase in voltage and frequency, any lack of generation will cause a drop in voltage and frequency. That's why the generation always follow the consumption; all generators sense changes in consumption (by measuring the system frequency), and adjust their input to match (for instance, by adjusting the fuel intake). When they don't (usually because the change was too fast, like when large blocks of generators or consumers drop suddenly from the grid), protective systems will disconnect the generators and/or consumers until the grid is balanced again. Storage (which is still uncommon) only does a temporal shift of the consumption and/or generation, it doesn't change the amount (other than the inevitable losses).
That is, if you use 200W less, the generators will adjust to generate 200W less power (actually a bit more than 200W, because of losses). If millions of people use 200W less, the generators will adjust to generate hundreds of megawatts less power.
(Also pondering moving my NAS to an ARM SBC as well but not sure it's worth the hassle since the mini Intel i3 PC idles at 10W.)
For work however, a programmer just can't do with those underpowered machines if they want to be productive and not wait 3 minutes for incremental compilation after each change they make (which an LSP server does, and even if it didn't, re-running tests does the same anyway).
I am happy to work on a more ecological machine if somebody optimizes the dev tooling and my programming languages' of choice compilers and linkers. I'd absolutely love it if all my machines idled at 5W and peaked at 35W. But if I am to support my family, that stance isn't easily achievable today. Yet.
And, the amount of electricity that you, the developer, spend testing your code will almost always be eclipsed by that of your users if more than a dozen others use your tool.
So, again: why does it matter how power-efficient the CPU you're testing on is, as long as it's slow (to produce the proper throttling effect)?
I was alluding to replacing the idea of holding on to a Pentium 4 with buying a modern, more eco-friendly, but ultimately just as anemic, CPU.
Not a perfectly representative test, sure, I just felt that it was a good compromise between "test your code on weak machines" and "be environmentally responsible".
So yep, I did conflate weak CPU with low-wattage CPU, you are right.
That's not it. My goal is to spend the minimum realistic sum for tech that enables me to do my job well and long-term so I am financially free and help the businesses that hire me, and keep improving my craft (for which I have love ever since a pre-teen).
That doesn't equal holding on to a MacBook Pro 2012 until 2030. It equals keeping an old machine around to check if the code in the final version of my current PR is well-optimized -- but I work on a much stronger machine because stuff like LSP and re-running tests is crucial for productivity. And we all know that most dev tooling is generally extremely demanding.
Let me be 100% clear here: I am sharing your stance in general but there are complications I am forced to consider and act accordingly with:
- Software gets slower with time, so I have to upgrade. Me upgrading only once 7-8 years is, I think, a fairly heroic effort on my side. I've seen businesses that blindly upgrade everyone's laptops every 3 years, zero questions asked.
- You and I have no recourse whatsoever against the big players who make disposable tech. You think I don't want them fined all the way to bankruptcy and even jail? I would love that. But we can't make it happen.
- My "logic" is simply of a family man with a ton of responsibilities and a pretty demanding job. Please don't make me the villain because I am doing my very best just to function and have a few precious relaxing hours per day. Most of the common folk will never be willing to sacrifice the little "me time" they have just so they free some ecological bandwidth... which will be quickly consumed and re-balanced (in the wrong direction) by those who create huge and environmentally disastrous manufacturing facilities.
- I love to indulge in a new tech but I have mostly tamed this wrong impulse. Doesn't mean I have to hold on to inadequate machines until they fall apart in my hands however.
---
Again, I get where you are coming from but please don't vent on me for doing the best that I can without sacrificing all the comfort and free time that I already don't have much of.
There are much bigger villains out there that deserve your frustration more than I do.
There's a podcast that my wife listens to quite a bit call Outrage and Optimism about the climate crisis, and it's essentially my approach - I am angry about the lack of leadership by governments, but I also feel like people need to be optimistic about what we can achieve together, including pushing governments to act.
I took part in the initial Extinction rebellion protest in London, and although I don't think it achieved much in immediate concrete terms, and I feel like the organisation is going backwards now, I do think it galvanized a lot of people into believing there are enough people out there who want meaningful action that speaking up is worth it. I was handing out leaflets to people from all walks of life - from a guy in a sharp business suit to a local building foreman who runs a vegan group - and only got one person out of hundreds who thought it was pointless. Most were actively enthusiastic and felt glad that there were lots of other people who shared their concerns.
It's really cool that spreading awareness works! I just wish we collectively as a civilization finally move to the next stage after it because ever since I exist (I am 41 y/o) people were mostly only spreading awareness. Guess I am getting old and jaded because I'd like to see some action on these extremely important topics one day.
So, there is a high bar for replacing a computer with a new one to actually save net resources, but an actual 10x reduction in power consumption like replacing a P4 desktop with an RPi is big enough to pay off reasonably quickly.
I am even more interested in how the formula works out if you buy one professional laptop (say, Lenovo X13) with a Ryzen CPU -- because they consume less power -- and I am looking forward to reading such an analysis sometime in the future.
It ran great with a few optimisations (or more specifically, removal of some really dumb code).
It seemed really obvious to me to ensure it would run well on a broad array of old hardware, and I suspect this is because of all the time spent on OCAU as a teenager trying to get the cheapest hardware possible to play the latest games.
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!
Even if not prioritizing cross-platform, Electron has some serious appeal.
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.
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.
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.
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.
Yes. You are not a Javascript Programmer, or a Frontend Programmer; Choose the right tool for each job.
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.
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...
Assuming you are referring to “pure”, in the context of functional programming and isolation of side effects.
Allow me to quote me, to clarify this part, then.
"when [they aren't] a great fit for the host language"
However "clean code" connotes to me the techniques advocated in "Clean Code" by Robert C. Martin, which amongst other things, advocates small descriptive functions.
Compilers are software. A "smarter" compiler is probably going to consume more resources.
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.
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.
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.
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).
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.
"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.
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.
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.
Not browsers, not photo editors, not games, not many chat applications. Certainly there must be some big ones that do right?
The dozen cross platform libraries that have been around for multiple decades are all 100 times faster than the electron, that's the point.
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.
Even GTK is cross platform!
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.
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_...
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.
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.
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.
Operating systems, particularly Windows. Given fixed hardware, you cannot expect an operating system to continue working indefinitely.
They all run processes, do they not?
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.
"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.
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.
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).
> 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.
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)
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.
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.
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.
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.
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.
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...
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.
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.
?? 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.
Maybe the question to ask is how much of this is to the benefit of the end user versus building ever more sophisticated adtech.
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.
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?
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.
> 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.
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.
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..)
Yeah, I'm never buying a glossy display again though. You helped me make a decision.
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)
But realistically Google chat uses more ram than the PC I used MSN messenger on even HAD.
And msn was “hoggish” for the time.
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?
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.
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.
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
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?
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.
> 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.
"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.
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.
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.
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.
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.
If you just want to draw text, you can simply use Notepad or Notepad++. VSCode has a lot more functionality, though.
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.
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.
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.
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.
The condition that the software has to be able to run on a Pentium 4 makes quite some performance optimizations impossible.
/s
-O0 -fsanitize=address -fsanitize=undefined
And things have to stay instantSo far that has reliably meant that the software is useable on e.g. a raspberry pi 3.
Instead you're optimizing for an environment with totally different performance characteristics, and manually doing low value optimisations that the compiler could normally handle. (E.g. O0 will mean no inlining, so you're incentived to do it at the source level, wasting effort, making the source less readable, but not actually getting any speedup on a production build )
It's definitely not something I felt the need to do so far - my code is chock-full of high-level abstractions (and a lot of TMP).
Where this helps is, noticing things like redoing a computation every time instead of caching the results, copying things left and right, etc. and more generally preventing "death by a thousand cuts" as just iterating a semi-large array more than necessary will make things noticeably slow if using asan (and, in my experience, slow computers - i've got a non-negligible portion of my user base using things like 2008 entry-level laptops for instance)
Alternatively, on Linux you can limit the maximum CPU frequency with something like
FREQ=800000 # 800 MHz
for i in /sys/devices/system/cpu/cpu[0-9]*; do
echo $FREQ > "$i/cpufreq/scaling_max_freq"
doneIt should work, if I'm reading this correctly: https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_p...
One trend at my company is to have microservices, where a single app is "single function" and uses a LOT of network traffic to talk to other "single function" applications.
Not such a good choice. It was kind of a "strung out" processor, with an overly deep pipeline, plus there was that RDRAM business...
I'd say maybe an Intel Pentium III coppermine, or maybe go AMD and choose the original Athlon.
> I only say this half-seriously
Why just half-seriously? Make it totally serious.
> If it's unusable, go back and optimize some more.
That too, but even more than that: Go back and make more initialization lazy; make sure your UI isn't overly de-prioritized in favor of other work; and make sure you have logic and UI for when certain thing take time, allowing them to still carry out some activity while waiting.
Problem is that then AVX became a common thing (at least in part of what I run) so that processor became unusable. I moved to an i3-3120m, which supports AVX, but then AVX2 became a thing.
I could've gone for a 4000-series i3 at that point, but I just grew tired. And Pentium/Celerons are a bigger mess to find because some of them are Atoms now. For example, I have a N4000 sub-notebook that I got for my mom to check her email and view online videos, and the things feels pretty snappy for those things. But then you try to run some numerical code and you find it's 50-100x slower than their bigger siblings... Turns out it has no AVX of any kind, and event though it says it supports SSE4, it feels possibly slower than the older Pentium I mentioned at the start, even with faster, dual-channel memory, and those old Intel didn't even have SSE4, just SSE3. But possibly at that point the 35W thermal headroom of theT5600 plays a big part as the N4000 is passively cooled and has a 6W TDP.
Moral of the story? Even if you try to, it's hard to pick a slow/old processor that will support all the operations that your software could use. Some of the give a huge speedup. You have to pick your battles. You'd probably have an easier time underclocking a lot out of your current processor (and disabling a few things?) and call it a day for performance testing.
I just installed Linux Mint on my 2013 MacBook Air, and now it's fast enough that you wouldn't know it's an old computer. Really amazing, it seems like Mac OS in particular is just super resource heavy. I realize Linux pretty much defeats the purpose of owning a Mac, but I'm just glad not to have to throw out an old computer that has seen me through my entire career shift into programming so far.
Linux absolutely flies on a Ryzen 4700U with an NVMe SSD. ^_^
Just kidding But yes, command line utilities have never been faster.
My ProBook with an i5-8250U spins up its fan for no reason while doing next to nothing on Linux with i3. And no, there's no "borken power management because Linux" issue, the battery actually lasts a long time (comparable to the official specs, which are presumably for Winows).
But curiosity got the best of me one day and I opened it up. The cooling system is an absolute joke. The heatsink is ridiculously small, my iPhone 7 probably has a bigger one.
Same story with an EliteBook something, with an i5-7xxxU CPU. I actually switched the EliteBook for the ProBook because I could add extra RAM.
However, I don't have any "slowdowns or stutters" with this machine, and I usually run it attached to an external 4k screen.
That's the interface I have in mind:
https://www.youtube.com/watch?v=OBI2liYIvdY
I don't feel like the current 2021 interface offers any advantages over it, and yet it uses far more resources to load and open things smoothly.
And yet somehow opening a text file is as slow if not slower.
I've been happily using non bloated tools for years now.
Obviously this isn't for everyone. ;)
not every programmer think this is fun. Some programmers prefer to code up features, rather than learn or test out esoteric ways to micro-optimize.
FTFY
40 years ago writing code was a lot harder; improving that has allowed a lot more interesting things to be built (both bc people can work faster and at higher levels of abstraction and because development is more democratic, leading to a wider pool of people writing things). The cost has been high though; few people think about the hardware and even the term “bare iron” is used unironically to refer to a machine running a multi-tasking OS!
But I think this will swing back the other way. Not by removing the abstraction but by “melting” some of the abstraction implementation layers. Hard work on improving interpreters and compilers has always been one of the ways, but assembly-optimized hotspots and tighter integration in some of the stack elements will be increasingly worth doing because fixing that speeds up all the developers working at higher levels.
The downside is that you won’t be able to, say, easily customize that version of React you’re deploying. But nowadays you really want to stay away from that anyway, in 99.99% of cases.
So bake those supply chain vulnerabilities right in there, nice and deep.
When you load 50 (or for the tree, 500) independently developed modules the probability of failure (or vulnerability) is typically the sum, not product, of the failure probability of each component. The same reason why not everything is implemented as a fleet of microservices.
Few worry that the TCP implementation in your OS is a monolith, and one that is tightly integrated with the IP code. This will make increasing sense further up the stack, for good or ill.
There are trade offs both ways.
But yeah, agree that the odds of failure are probably lower pulling in a handful of monoliths that are well exercised than hundreds of miscellanea of varying robustness.
That's not even including the fact that processors are actually processor simulators these days.
Thus, "bare metal" is actually "resource division among managed processes on a simulated processor" which sure sounds a lot like a VM to me. Modern OSs are in fact a form of virtual machine, and we found it useful to have yet another.
Arguably docker type of simulation introduces yet another level so a react app in a docker shell in a VM cluster is really a interpreted application on a simulated operating system, on a resource sharing virtual machine, on a virtualized hardware environment, on a multitasking virtual machine, running on a simulated processor that's implemented on a _real processor_.
If you write a program that is launched by an OS you are by definition not manipulating the hardware directly. Those POSIX calls go somewhere.
I write such code from time to time: a boot loader, a small OS, or apps that run with no OS at all.
AKA Less's law
I think both are true.
ARM: https://developer.arm.com/support/arm-security-updates/specu...
There are also a bunch of mitigations for AMD.
Look at the prices of graphics cards. Or, nowadays, hard drives thanks to Chia. It's going to be a goddamn tragedy for the entire planet if Chia continues to grow in popularity.
Similarly, when a new browser update goes out it may or may not make all the web apps you rely on slower (or break them), so any web benchmarking also needs to be re-run from scratch on a regular basis. New Chrome and Firefox releases "ride the trains" every 6 weeks or so, and they quietly push changes to the browser more frequently than that which can occasionally impact perf or behavior too.
"Security by default" affects, by default, also trusted workloads. Games, desktop editing software, word processors, spreadsheets running dumb totals in big tables, and virtualized computing workloads running in the cloud (where it has a serious financial impact for whoever pays the cloud bill). All of them pay the Javascript tax. Worse, there doesn't seem to be any solution in sight, we have become too reliant on the damn thing.
as trusted workloads?
The problem is the obvious solution - get rid of the hostile programs! [i.e. removing the capability of any website to run code from anywhere on your machine] - has been ruled out from the start. Now we are only left with non-obvious solutions and bad trade-offs. Things like CPUs with fast/slow microarchitectures on the same die so you may run the JS engine on a slow core that has a harder time messing with things, for example. How many engineer-millenia are poured into trying to make this work?
If one could get rid of the hostile people, we wouldn't need passwords. Login is enough. Much easier to develop webapps. But we can't get rid of the hostile people and we can't get rid of the hostile programs.
The only semi-successful way to get rid of the hostile programs is Apple-style walled garden. But even there malware happened. And giving up all your freedom for that kind of safety is like going to the jail voluntarily to be safe from the outer world. I don't think that this approach would work for everyone.
Has it even been tried? Given that we do need to protect against info disclosure vulns, even a rough attempt at proper MLS would be way more feasible than treating all programs as untrusted/hostile or all data as equally sensitive.
I'd have higher hopes Samsung pulls something off with their fab but still skeptical. Apple seems to be generations ahead in this space.
While Rosetta might be good, I'm sure it'll be gone in a few years and most people won't notice. It won't work with Windows.
What law? They locked down iPhone and law does not care. How is it different for Mac? The could've locked down their M1 Macs, but they deliberately chose not to.
"locked down" from your comment as I understand it, is just making it hard to gain root on the device. Nothing in most Western law prevents you or I from jailbreaking the phone or cracking it open and looking at it under a microscope or whatever. Thats good. What would be perfect is of course publish schematics and manuals etc.
Others have documented the engineering that went into a new boot system for the M1 to make multi-boot and custom kernels possible. Engineering that would be pointless if no one were expected to use it.
Actually I look forward to it, eventually Linux and BSD will stand alone as the only classical monolithic kernels, which is kind of ironic, given how much containers and hypervisors they get loaded with anyway.
- M1 machines are 'closed' because of Apple and not because of the CPU architecture. They could adopt RISC-V and the GPU and drivers would still be closed etc.
- M1 is fast because Apple have invested a lot in building an outstanding CPU design team and the economics of their business allow them to fabricate on the latest TSMC node.
- Apple could have locked down the M1 machines much more completely than they have done.
If you want fast 'open' systems you need to work out how to incentivise firms to build systems in this way. RISC-V will not magically get there on its own because its a more 'open' ISA than ARM. In the meantime credit to those who are working out how to get the most out of the M1.
0: https://www.raptorcs.com/content/TL2WK2/intro.html#sidebar-s...
Today it's an average expensive chip, tomorrow it's below average. It's really hard to keep up with the world.
After all an optimisation is designed to alter the timing. If all actions must have the same timing, optimisations fail.
Do we simply offload any sesnitive processing to specialised chips? The silicon wafer seems to be developing vulnerablities like a network.
Though I think we're getting now to the point that we would have gotten to then. AMD bought x86 another 15 years of life.
In Portugal there were only PCs with Intel CPUs around, the Cyrix, NEC and other clones were hardly anywhere to find until the first Athlons came to be.
Years ago, I remember reading Itanium stalled because writing compilers to ably support speculative instructions was hard or simply impossible.
Luckily, we only need this for untrusted code. What really peaves me is that trusted code is now having to run slower as well.
But then again, browser exploits have been a thing forever. I expect that something bad will happen to my computer if I'm visiting shady websites.
So my question is: are shady websites _more_ dangerous now that these side channel attacks have been discovered? (serious question.)
Supply chain attacks exploit that fact that far too much code is inappropriately trusted.
I don't like that everything has to get 25% slower because your SSL session setup needs to be protected.
Realistically though, most userland software falls into that category nowadays:
- JS-driven web apps like GSuite
- Sandboxed "App Store" apps on mobile and even desktop
- Potentially any other desktop app that is exposed to content originating from the web or email (e.g. Acrobat, desktop Office, etc.)
I wonder if security models need to become less black-and-white, with a middle tier of trust for apps or domain names that should still be sandboxed but are trusted enough that we're willing to trade some risk of timing exploits for improved performance?
I'm reverse engineering the Apple M1 and haven't found any trustability issues yet (besides the proprietary early stage bootloaders, but everything has that). There are some 12 or so coprocessors running proprietary firmware, but all of them are safely behind OS-controlled IOMMUs and not privileged to take over the system. There is no ME, no SMM, no TrustZone, nothing running with higher privilege than the OS. Most of the coprocessors have at least inspectable firmware (except the Secure Enclave, but you can just turn it off). The ARM architecture design makes it near impossible for an early boot backdoor to, say, run your OS in an undetectable VM too. No updatable microcode.
On x86 you have the ME running secret code with higher privilege than the main CPU, as well as SMM running secret code on the main CPU at a higher privilege than the OS and stealing cycles from it, as well as a rather poor track record of proper IOMMU sandboxing (especially for anything that isn't a PCI device), and secret, encrypted microcode updates.
Well, not secret if running coreboot… I'm not sure if coreboot's SMM handler might call into FSP/AGESA though.
... except for assuming "EL3 seems to be missing" means "EL3 doesn't exist" instead of "the bootrom dropped to EL2 before we got control".
Not saying I have any evidence to the contrary, nor is this in any way a criticism of your awesome work. Just saying that this will unfortunately remain forever unknowable unless Apple decides to volunteer information.
Personally, if I were Apple, instead of removing EL3 I would've left it in but unused, accessible only to code signed by Apple with the public key burned into silicon. As a way to mitigate currently-undiscovered silicon bugs.
Your argument is equivalent to "Apple might have backdoored the CPU". Well, yes. So might have every other CPU vendor.
If EL3 were to exist, for starters, it would have no way to receive interrupts, as Apple uses both IRQ and FIQ for the OS (normally FIQ is used for EL3 on platforms with a secure monitor).
Thank you for mentioning this. I retract my earlier (GP) comment.
I didn't know that ARM chips self-declared their support for EL3 with register bits that could be read! But yes, they do:
https://www.kernel.org/doc/html/latest/arm64/cpu-feature-reg...
These bits amount to Apple saying "there is no EL3" and constitute one of the few pieces of official documentation attributable to Apple.
PS, if you're maintaining any kind of list of "why the M1 is more trustworthy than chip XYZ", the fact that there is a MSR-like bit declaring that the feature doesn't exist should definitely go on that list. Just to make it clear that EL3 not existing was something declared by the chip rather than assumed by the reverse engineers.
Can you explain this? It doesn’t sound right.
You jest but…..
But partially because you like money and can make it exist pretty easily and cheaply
Would perhaps a solution to this be to have mixed cores: some cores intended for managing passwords and other secure data with all the performance reducing mitigations to avoid timing attacks. Other cores completely unlocked, no mitigations, and intended for non-secure computation (gaming, number crunching, ...).
Then let the OS and programmers ensure it's known which computation is marked as secure and which is not, to decide on which cores it can be ran.
Even if you figure out how to do it though, you can still fall to a double failure: your safe code doesn't leak passwords via a timing attack, but via something else (buffer overflow?) it leaks the password to the unsafe side, which in turn leaks it via a timing attack.
Applying the patch should be opt-in if you ask me. But of course, most sysadmins are hopeless. So then the OS vendors push it out, it's safer than letting the decision to uninformed people.
Sysadmins/DevOps/SREs aren't hopeless, they just have different incentives and responsibilities. Default secure with the option to let down your guard when the need is there is always always the right choice. You wouldn't have your firewall default allow with a blocklist. You wouldn't grant everyone sudo access and then maintain a list of commands they can't execute. Such a thing is impossible to maintain.
For me specifically I manage too many servers to bother with this. It's going to be deployed to everything without exception and if you need more performance we'll rack more hardware. The cost of more CPUs is less than the risk that something will slip through the cracks. I don't care that your pet service doesn't execute any untrusted code, I'm not carving out exceptions when I have 20 teams constantly asking for stuff.
Sounds like your IT department is severely understaffed and is unable to meet the needs of the developers without reducing service.
> but that analysis is nearly impossible an filled
Like could we just not use the browser's password manager or use a separate browser for sensitive websites (eg banking)?
That's like Ford selling a truck with 500hp and then later recalling it to detune it to 400hp. The truck I have is no longer the truck I wanted or the truck I paid for. Ford owes me what it said on the label.
What if Intel wanted to sandbag existing products to promote new ones?
So pardon me, but from a lifelong AMD enthusiast, you all deserve this...
"Hey guys, why are you still running Intel? That shit is like 2 generations behind my AMD in performance and reliability."
Damn, that felt good.
Also why would you be a life long enthusiast of a specific company? Why not buy what works best at any point in time?
Also, AMD almost lost everything. At one point they had to sell their own HQ and lease it back to generate cashflow and keep the doors open.
If they had closed, Intel research budgets would tank. They wouldn't have nearly as much incentive to innovate. Without Dodge motor company you would still be driving a Ford Model T in black.
If AMD died instead of making the original Athlon, you would still be stuck with a Pentium MMX because Intel could have stopped innovating and kept their market share.
https://en.wikipedia.org/wiki/Electromigration
It takes on the order of 100 years for well made modern CPUs to fail due to these effects, but poorly made CPUs could fail far earlier. There are likely some nonzero number of failures attributable to electromigration.
There are some people who buy overclockable parts and don't overclock them because they are more robust. It's unknown exactly how or why CPUs fail. Taking them apart to check is an extremely expensive endeavor. But sometimes they do.
But in any case, if you have one chip that decreases in performance 10% per year due to security mitigations and another chip that remains consistently performant, it is something to consider when shopping.
Why would this be true?
I mean, no offense, but that is literally the focus of this article and this discussion.
You hallucinated 10% a year from a single incident and called it "reliability".
Where is the evidence that AMD is more 'more reliable' than Intel?
Based on the Intel microcode release note [1] it doesn't seem like client HSW got any update this time, only HSX (Haswell Xeon).
---
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Dat...
Is that microcode fix somehow better than mitigations in the kernel?
I wonder if it will allow AMD to catch up even further (even though AMD CPU were also affected).
That said, I don't think this is related to any of the named Spectre variants.
The container hasn't been rebuilt in many months (like 7) and the only thing that has changed on the machine is CentOS updates.
So... why not with CPUs?
What CPU are you replacing it with? Most if not all modern CPUs are vulnerable to this so changing it makes little sense. Even if you can change it, you'd need to switch motherboard as well.
Then with that money I can do whatever I want... eg. buy an AMD washing machine... or generally a newer, faster one, becuase some time has gone by. Or go on a vacation. Or drugs and prostitutes.
We wouldn't accept that on any generic customer product. We'd recall whole fleet of cars if they had severe flaws that directly affect their performance.
There might not be viable alternatives, but there should be at least something from CPU makers to help swallow the pill.
- keep the old "firmware", and risk the machine catching fire
- put the new firmware on, and make it wash slower
Yeah... I'll choose returning it to the store.
Or perhaps more accurately, someone spoiling your clothes by putting a dye in their pocket and letting you wash it in the same batch.
The problem isn't that they made the patch, it's that they made a defective part in the first place. The patch just fails to cure the fact that they made a defective part.
The remedy for an entire industry's product performing to a degree less than advertised is a class action lawsuit (good luck getting more than about five dollars for something like this), not returning the products for a refund.
As someone said below (maybe after you posted)
> Then with that money I can do whatever I want... eg. buy an AMD washing machine... or generally a newer, faster one, becuase some time has gone by. Or go on a vacation. Or drugs and prostitutes.
The other options here are "Well, I'll just not have a washing machine". Which you can do, but it will take more time to clean your clothes and cost more money after not very many washes at all (or you hand-wash, but then you're looking at 10x as long). Same for computers -- if simply not having one is an option for you, you probably haven't noticed the degradation.
They should give you your money back, or replace the CPU with one that is as fast as your old one before they crippled it - ie. new CPU with eg. higher clock to compensate for the speed loss due to this fix.
If you buy a 1000lumen lightbulb, and the manufacturer has to lower the output by 50% because of overheating, they should either give me my money back, or give me a 2000lumen bulb which was crippled to 1000lumen, to get the original brightness i bought the bulb for.
One thing you might say is that this change happened even to lightbulbs I've had for 5+ years. I can buy a functional 1000lm bulb for the same price now, due to the march of technology! The problem is that I've been using the lightbulb for five years already. If you use a lightbulb for five years, and then it fails entirely, the manufacturer is never going to give you a full refund: why would they give you a full refund for a lesser failure mode?
The choice is not between silently letting manufacturers cripple stuff, and having non-crippled stuff. The choice is between silently letting manufacturers cripple stuff, and loudly letting manufacturers cripple stuff. You're welcome to do the latter, but your stuff is still going to be crippled.
We expect that this issue will be sorted out soon.
In the meantime we hope you'll consider that speed and security are sometimes traded off, in this world of network-aware, gigahertz speed washing machines which you can also use to do banking, create spreadsheets and watch your favorite movies.
No one gave you a guarantee that “there will never be any security issues with this product and if there are, mitigations will cause no performance degradation”.
If you want that promise you’re gonna have to pay for it, man. And it’s not gonna be a flat fee. That’s an insurance model.
The problem, IMO, is that a manufacturer of a high-quality washing machine has the human ability to go through and engineer out or (or economize in) every conceivable failure mode. There's no need to issue updates, because it only does the specific behaviors that it was designed to do. Each part has a wear characteristic, can corrode, can be mechanically stressed...but a pressed sheet metal bracket is fundamentally always going to be a bracket, either it corrodes, or wears, or yields, or it doesn't, or else it holds the things it's supposed to hold, there's just not that many ways in which the performance of a bracket can surprise the designer. The owner's manual says it's to be transported carefully, installed on a flat surface indoors, plumbed to water/wired to 120VAC/drained through a standpipe, and then you operate it by adding clothes and turning the knob. It's a fixed-purpose washing machine, that's what it does.
In contrast, Intel employed very smart, hardworking designers to write the microcode and HDL that describe the `vmovdqu YMMWORD PTR [rax], ymm1` assembly instruction, they thought about what that meant, what side effects it could have, why it should do what it does, and they probably were quite pleased when they optimized it to be faster when doing zero stores. But while the hypothetical ME for our washing machine could probably comprehend every requirement for the bracket, the Intel designers didn't build a fixed-purpose machine, they built a general-purpose machine that runs both trusted and untrusted code of unknown, highly flexible contents. The state machine describing all possible results of a Turing complete processor even with storage limited to mere gigabytes instead of an infinite tape, is unimaginably large. I maintain that numbers over a few thousand are humanly impossible to fully imagine, but to put it in concrete terms, worldwide, literally every second on the order of 10^20 novel combinations of 64 bit instructions are executed by a CPU, and every second, millions of programmers and computer users are generating never-before-seen demands of the hardwrae.
It's impossible to predict every side effect of every combination of instructions a CPU will run. Meanwhile, the brackets are simple brackets, handing the same requirements and performing the same functions that the designer should have known about when they designed it.
Just a note that the title should be:
Your CPU May Have Slowed Down on Wednesday
bug*
feature*
(bug*)
Instead, the title should just state what is the case: "Intel CPU-update causes slowdown" or something like that.
On the whole I'd say that the original title is much better than most.
The way it's phrased implies a periodic event, which is what makes the title clickbaity.
The title originally said "last Wednesday" but I waited too long to publish it and was actually two Wednesdays ago...
Effective but unethical, but unethical in the sense that marketing psychology is unethical.
Unethical because it uses well known human psychological weaknesses to help nudge a target towards an action that they themselves may not have chosen to perform without the nudge.
If I was asked, i'd wager that most motivated persuasion is unethical to some degree.
Imply one thing, deliver another and this leaves an aftertaste even the actual content is good (like in your case).
> Clickbait is a text or a thumbnail link that is designed to attract attention and to entice users to follow that link and read, view, or listen to the linked piece of online content, with a defining characteristic of being deceptive, typically sensationalized or misleading. A "teaser" aims to exploit the "curiosity gap", providing just enough information to make readers of news websites curious, but not enough to satisfy their curiosity without clicking through to the linked content. Click-bait headlines add an element of dishonesty, using enticements that do not accurately reflect the content being delivered.
I don’t feel this applies in this case because it fails to be deceptive, misleading or dishonest. (Parts of the definition certainly apply, but not enough.)
Sure, you could have a title like “Intel just slowed down their CPUs with a microcode update” (and I do prefer explicit titles like this—you should see the titles I write myself, 70- and 80-character limits severely cramp my style), but the article’s title isn’t particularly bad.
See, we can also play that bait game
I have a Zen 2 box which I'm just starting to learn about.
Last laptop I bought the missus at xmas was a Ryzen 4000 and that thing screams performance wise, incredible for 800 quid.
Perhaps there is an MSR bit you can flip to set the behavior back to the old way, but none has emerged so far.
Might want to look for them here: https://github.com/intel/Intel-Linux-Processor-Microcode-Dat...
As to how to actually use those files to get your "intel-ucode.img", just take a look at: https://archlinux.org/packages/extra/any/intel-ucode/
For the "iucode_tool": https://gitlab.com/iucode-tool/iucode-tool/-/wikis/home
The actual PKGBUILD for it on Arch Linux: https://github.com/archlinux/svntogit-packages/blob/packages...
---
cd Intel-Linux-Processor-Microcode-Data-Files-microcode-${pkgver/./}
rm -f intel-ucode{,-with-caveats}/list
mkdir -p kernel/x86/microcode
iucode_tool --write-earlyfw=intel-ucode.img intel-ucode{,-with-caveats}/
The above gives you "intel-ucode.img". Copy it to "/boot/". Run "mkinitcpio -p linux" or the like.First you kill AMD with "efficiency". Then you "encourage" users to upgrade, since secutity updates make this efficiency disappear.
How is this even legal.