Live data from Hacker News

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

twitter.com

411–420 of 842 posts

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

#411
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…

Except you’re self selecting for a company that has high engineering costs, big fat margins to accommodate expenses like additional hardware, and lots of projects for engineers to work on. The evaluation needs to happen in the margins, even if it saves pennies/year on the dollar, it’s best to have those engineers doing that than have them idling. The problem is that almost no one is doing it, because the way we make…

I think the parent's point is that if Google with millions of servers can't make performance optimization worthwhile, then it is very unlikely that a smaller company can. If salaries dominate over compute costs, then minimizing the latter at the expense of the former is counterproductive.

> The evaluation needs to happen in the margins, even if it saves pennies/year on the dollar, it’s best to have those engineers doing that than have them idling.

That's debatable. Performance optimization almost always lead to complexity increase. Doubled performance can easily cause quadrupled complexity. Then one has to consider whether the maintenance burden is worth the extra performance.

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

#412
post #29
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…

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

And text that is not a pixely or blurry mess. And Unicode.

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

#413

Earlier quoted context omitted.

Hm, you could do that quite easily but there isn't much juice to be squeezed from runtime selected data structures. Set with O(1) insert: var set = new HashSet (); Done. Don't need any fancy support for that. Or if you want to load from a database, using the repository pattern and Kotlin this time instead of Java: @JdbcRepository(dialect = ANSI) interface EmployeeQueries : CrudRepository { fun findByCountryAndGender(…

> Hm, you could do that quite easily but there isn't much juice to be squeezed from runtime selected data structures. Set with O(1) insert: But now you've hard-coded this selection, why can't the performance characteristics also be easily parameterized and combined, eg. insert is O(1), delete is O(log(n)), or by defining indexes in SQL which can be changed at any time at runtime? Or maybe the performance characterist…

There are research papers that examine this question of whether runtime optimizing data structures is a win, and it's mostly not outside of some special cases like strings. Most collections are quite small. Really big collections tend to be either caches (which are often specialized anyway), or inside databases where you do have more flexibility.

A language fully integrated with the relational model exists, that's PL/SQL and it's got features like classes and packages along with 'natural' SQL integration. You can do all the things you ask for: specify what operations on a collection need to be efficient (indexes), whether they're durable (temporary tables), atomically updatable (LOCK TABLE IN EXCLUSIVE MODE) and so on. It even has a visual GUI builder (APEX). And people do build whole apps in it.

Obviously, this approach is not universal. There are downsides. One can imagine a next-gen attempt at such a language that combined the strengths of something like Java/.NET with the strengths of PL/SQL.

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

#414
Code bloat: https://en.wikipedia.org/wiki/Code_bloat

Software bloat > Causes: https://en.wikipedia.org/wiki/Software_bloat#Causes

Program optimization > Automated and manual optimization: https://en.wikipedia.org/wiki/Program_optimization#Automated...

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

#415

Imagine software engineering was like real engineering, where the engineers had licensing and faced fines or even prison for negligence. How much of the modern worlds software would be tolerated? Very, very little. If engineers handled the Citicorp center the same way software engineers did, the fix would have been to update the documentation in Confluence to not expose the building to winds and then later on shrug w…

"If this country built bridges they way it builds [information] systems, we'd be a nation run by ferryboats." --Tim Bryce

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

#416

Earlier quoted context omitted.

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…

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…

IMO they just don't think of "initial launch speed" as a meaningful performance stat to base their entire tech stack upon. Most of these applications and even websites, once opened, are going to be used for several hours/days/weeks before being closed by most of their users

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

#417

Earlier quoted context omitted.

I don't trust that shady-looking narrator. 5% of what exactly? Do you mean that testing for x >= start and Or would bounds checking in fact more than double the time to insert a bunch of ints separately into the array, testing where each one is being put? Or ... is there some gimmick to avoid all those individual checks, I don't know.

You only need to bounds check once before a for loop starts, not every iteration.

If they're all being inserted contiguously.

Anyway that's a form of saying "I know by reasoning that none of these will be outside the bounds, so let's not check".

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

#418

Earlier quoted context omitted.

And I'd argue that we've seen tons of innovation in the past 18 years aside from just "the smartphone" but it's all too easy to take for granted and forget from our current perspective. First up, the smartphone itself had to evolve a hell of a lot over 18 years or so. Go try to use an iPhone 1 and you'll quickly see all of the roadblocks and what we now consider poor design choices littered everywhere, vs improvement…

Your post seems entirely anachronistic. 2007 is the year we did get video streaming services: https://en.wikipedia.org/wiki/BBC_iPlayer Steam was selling games, even third party ones, for years by 2007. I'm not sure what a "VS-Code style IDE" is, but I absolutely did appreciate Visual Studio ( and VB6! ) prior to 2007. 2007 was in fact the peak of TomTom's profit, although GPS navigation isn't really the same as gene…

Sublime Text was out by 2008. Its spiritual predecessor, TextMate, was out a few years before that.

And of course, Vim and Emacs were out long before that.

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

#419
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…

Mine open instantly, as long as I only have one open at a time. The power users on HN likely encounter a lot of slow loading apps, like I do.

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

#420
post #78

Earlier quoted context omitted.

I just clicked on the network icon next to the clock on a Windows 11 laptop. A gray box appeared immediately, about one second later all the buttons for wifi, bluetooth, etc appeared. Windows is full of situations like this, that require no network calls, but still take over one second to render.

Windows 11 shell partly uses React Native in the start button flyout. It's not a heavily optimized codebase.

That's the point. It's so bloated that an entirely local operation that should be instantaneous takes over 1 second.
Post reply on HN