Live data from Hacker News

The world could run on older hardware if software optimization was a priority

twitter.com

501–510 of 842 posts

Re: The world could run on older hardware if software optimization was a priority

#501
post #12

I like to point out that since ~1980, computing power has increased about 1000X. If dynamic array bounds checking cost 5% (narrator: it is far less than that), and we turned it on everywhere, we could have computers that are just a mere 950X faster. If you went back in time to 1980 and offered the following choice: I'll give you a computer that runs 950X faster and doesn't have a huge class of memory safety vulnerabi…

The cost of bounds checking, by itself, is low. The cost of using safe languages generally can be vastly higher.

Garbage collected languages often consume several times as much memory. They aren't immediately freeing memory no longer being used, and generally require more allocations in the first place.

Re: The world could run on older hardware if software optimization was a priority

#502

Earlier quoted context omitted.

we could of course theoretically make everything even faster. It's nowhere near the most optimal use of the available hardware. All we'd have to give up is squishy hard-to-measure things like "feature sets" and "engineering velocity." Says who? Who are these experienced people that know how to write fast software that think it is such a huge sacrifice? The reality is that people who say things like this don't actuall…

I mean do you think JavaScript and Python aren't easier than C++? Then why do they exist?

Javascript was made in a few weeks so that some sort of programmability could be built in to web pages. Python was made in the 90s as a more modern competition to perl for scripting.

Modern C++ and systems language didn't exist and neither was made with the intention that people would write general purpose interactive programs that leveraged computers 1,000x faster so that software could run 1,000x slower.

Re: The world could run on older hardware if software optimization was a priority

#503
post #29

Earlier quoted context omitted.

Except we've squandered that 1000x not on bounds checking but on countless layers of abstractions and inefficiency.

Am I taking crazy pills or are programs not nearly as slow as HN comments make them out to be? Almost everything loads instantly on my 2021 MacBook and 2020 iPhone. Every program is incredibly responsive. 5 year old mobile CPUs load modern SPA web apps with no problems. The only thing I can think of that’s slow is Autodesk Fusion starting up. Not really sure how they made that so bad but everything else seems super s…

You're a pretty bad sample, that machine you're talking about probably cost >$2,000 new; and if it's an M-series chip; well that was a multi-generational improvement.

I (very recently I might add) used a Razer Blade 18, with i9 13950HX and 64G of DDR5 memory, and it felt awfully slow, not sure how much of that is Windows 11's fault however.

My daily driver is an M2 Macbook Air (or a Threadripper 3970x running linux); but the workers in my office? Dell Latitudes with an i5, 4 real cores and 16G of RAM if they're lucky... and of course, Windows 11.

Don't even ask what my mum uses at home, it cost less than my monthly food bill; and that's pretty normal for people who don't love computers.

Re: The world could run on older hardware if software optimization was a priority

#504
post #492
post #317

So I've worked for Google (and Facebook) and it really drives the point home of just how cheap hardware is and how not worth it optimizing code is most of the time. More than a decade ago Google had to start managing their resource usage in data centers. Every project has a budget. CPU cores, hard disk space, flash storage, hard disk spindles, memory, etc. And these are generally convertible to each other so you can…

> I don't remember the exact number of CPU cores amounted to a single SWE but IIRC it was in the thousands. I think this probably holds true for outfits like Google because 1) on their scale "a core" is much cheaper than average, and 2) their salaries are much higher than average. But for your average business, even large businesses? A lot less so. I think this is a classic "Facebook/Google/Netflix/etc. are in a clas…

Maybe not to the same extent, but an AWS EC2 m5.large VM with 2 cores and 8 GB RAM costs ~$500/year (1 year reserved). Even if your engineers are being paid $50k/year, that's the same as 100 VMs or 200 cores + 800 GB RAM.

Re: The world could run on older hardware if software optimization was a priority

#505

Earlier quoted context omitted.

Sorry but it is absolutely the case that there are optimizations available to someone working in assembly that are not available to someone working in C++. You are probably a lazy or inexperienced engineer if you choose to work in C++. In fact, there are optimizations available at the silicon level that are not available in assembly. You are probably a lazy or inexperienced engineer if you choose to work in assembly.

Go ahead and give me examples of what you mean. I'm talking about speeding software up by 10x-100x by language choice, then 7x with extremely minimal adjustments (allocate memory outside of hot loops), then 25x - 100x with fairly minimal design changes (use vectors, loop through them straight). I'm also not saying people are lazy, I'm saying they don't know that with something like modern C++ and a little bit of know…

So you agree there’s a trade off between developer productivity and optimization (coding in assembly isn’t worth it, but allocating memory outside of hot loops is)

You agree with my original point then?

Re: The world could run on older hardware if software optimization was a priority

#506

Earlier quoted context omitted.

Your argument is exactly why we ended up with the abominations of C and C++ instead of the safety of Pascal, Modula-2, Ada, Oberon, etc. Programmers at the time didn't realize how little impact safety features like bounds checking have. The bounds only need to be checked once for a for loop, not on each iteration.

> The bounds only need to be checked once for a for loop, not on each iteration. This is a theoretical argument. It depends on the compiler being able to see that’s what you’re doing and prove that there is no other mutation. > abominations of C and C++ Sounds like you don’t understand the design choices that made this languages successful.

I understand the design choices and they're crap. Choosing a programming language shouldn't be a popularity contest.

Re: The world could run on older hardware if software optimization was a priority

#507
post #494
post #466

Earlier quoted context omitted.

The Wikipedia page for Market for Lemons more or less summarizes it as a condition of defective products caused by information asymmetry, which can lead to adverse selection, which can lead to market collapse. https://en.m.wikipedia.org/wiki/The_Market_for_Lemons The Market for Lemons idea seems like it has merit in general but is too strong and too binary to apply broadly, that’s where I was headed with the suggesti…

By the way, inferior goods are not necessarily poor-quality products, though there is a meaningful correlation, and I based my original comment on it. Still, a OnePlus Android phone is considered an inferior good; an iPhone (or a Samsung Galaxy Android phone) is considered superior. Both are of excellent quality and better than one another in key areas. It's more about how wealth, brand perception, and overall market…

> A OnePlus Android phone is considered an inferior good; an iPhone (or a Samsung Galaxy Android phone) is considered superior. Both are of excellent quality

No, the inferior good is a device with 2GB RAM, a poor quality battery, easy to crack screen, a poor camera. poor RF design and thus less stable connectivity, and poor mechanical assembly. But it has its market segment because it costs like 15% of the cost of an iPhone. Some people just cannot afford the expensive high-quality goods at all. Some people, slightly better-off, sometimes don't see the point to "overpay" because they are used to the bottom-tier functionality and can't imagine how much higher quality may be materially beneficial in comparison.

In other words, many people have low expectations, and low resources to match. It is a large market to address once a product-market fit was demonstrated in the high-end segment.

Re: The world could run on older hardware if software optimization was a priority

#508

Earlier quoted context omitted.

I use Windows alongside my Mac Mini, and I would say they perform pretty similarly (but M-chip is definitely more power efficient). I don't use Slack, but I don't think anything takes 20 seconds for me. Maybe XCode, but I don't use it often enough to be annoyed.

I have an i9 windows machine with 64GB ram and an M1 Mac. I’d say day to day responsiveness the Mac is heads and tails above the windows machine, although getting worse. I’m not sure if the problem is the arm electron apps are getting slower or if my machine is just aging

It's Windows. I'm on Linux 99% of the time and it's significantly more responsive on hardware from 2014 than Windows is on a high end desktop from 2023. I'm not being dramatic.

(Yes, I've tried all combinations of software to hardware and accounted for all known factors, it's not caused by viruses or antiviruses).

XP was the last really responsive Microsoft OS, it went downhill from then and never recovered.

Re: The world could run on older hardware if software optimization was a priority

#509

Earlier quoted context omitted.

Slack, teams, vs code, miro, excel, rider/intellij, outlook, photoshop/affinity are all applications I use every day that take 20+ seconds to launch. My corporate VPN app takes 30 seconds to go from a blank screen to deciding if it’s going to prompt me for credentials or remember my login, every morning. This is on an i9 with 64GB ram, and 1GN fiber. On the website front - Facebook, twitter, Airbnb, Reddit, most news…

> Slack, teams, vs code, miro, excel, rider/intellij, outlook, photoshop/affinity are all applications I use every day that take 20+ seconds to launch. > On the website front - Facebook, twitter, Airbnb, Reddit, most news sites, all take 10+ seconds to load or be functional I just launched IntelliJ (first time since reboot). Took maybe 2 seconds to the projects screen. I clicked a random project and was editing it 2…

> heavy anti-virus or corporate security scanning that's slowing your computer down more than you expect.

Ugh, I personally witnessed this. I would wait to take my break until I knew the unavoidable, unkillable AV scans had started and would peg my CPU at 100%. I wonder how many human and energy resources are wasted checking for non-existant viruses on corp hardware.

Re: The world could run on older hardware if software optimization was a priority

#510
post #217
post #91

There is an argument to be made that the market buys bug-filled, inefficient software about as well as it buys pristine software. And one of them is the cheapest software you could make. It's similar to the "Market for Lemons" story. In short, the market sells as if all goods were high-quality but underhandedly reduces the quality to reduce marginal costs. The buyer cannot differentiate between high and low-quality g…

The dumbest and most obvious of realizations finally dawned on me after trying to build a software startup that was based on quality differentiation. We were sure that a better product would win people over and lead to viral success. It didn’t. Things grew, but so slowly that we ran out of money after a few years before reaching break even. What I realized is that lower costs, and therefore lower quality, are a compe…

>There’s probably another name for this, it’s not quite the Market for Lemons idea. I don’t think this leads to market collapse, I think it just leads to stable mediocrity everywhere, and that’s what we have.

It's the same concept as the age old "only an engineer can build a bridge that just barely doesn't fall down" circle jerk but for a more diverse set of goods than just bridges.

Post reply on HN