Live data from Hacker News

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

twitter.com

541–550 of 842 posts

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

#541
post #217

Earlier quoted context omitted.

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…

You're on the right track, but missing an important aspect. In most cases the company making the inferior product didn't spend less. But they did spend differently. As in, they spent a lot on marketing. You were focused on quality, and hoped for viral word of mouth marketing. Your competitors spent the same as you, but half their budget went to marketing. Since people buy what they know, they won. Back in the day MS…

IIRC, Microsoft was also charging Dell for a copy of Windows even if they didn't install it on the PC! And yeah OS/2 was ahead by miles.

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

#542
post #217

Earlier quoted context omitted.

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…

You're laying it out like it's universal, in my experience there are products where people will seek for the cheapest good enough but there are also other product that people know they want quality and are willing to pay more. Take cars for instance, if all people wanted the cheapest one then Mercedes or even Volkswagen would be out of business. Same for professional tools and products, you save more by buying qualit…

Not everyone wants the cheapest, but lemons fail and collapse the expensive part of the market with superior goods.

To borrow your example, it's as if Mercedes started giving every 4th customer a Lada instead (after the papers are signed). The expensive Mercedes market would quickly no longer meet the luxury demand of wealthy buyers and collapse. Not the least because Mercedes would start showing super-normal profits, and all other luxury brands would get in on the same business model. It's a race to the bottom. When one seller decreases the quality, so must others. Otherwise, they'll soon be bought out, and that's the best-case scenario compared to being outcompeted.

There is some evidence that the expensive software market has collapsed. In the 00s and 90s, we used to have expensive and cheap video games, expensive and cheap video editing software, and expensive and cheap office suites. Now, we have homogeneous software in every niche — similar features and similar (relatively cheap) prices. AAA game companies attempting to raise their prices back to 90s levels (which would make a AAA game $170+ in today's money) simply cannot operate in the expensive software market. First, there was consumer distrust due to broken software, then there were no more consumers in that expensive-end market segment.

Hardware you mention (iPhones, Androids, Macs, PCs) still have superior and inferior hardware options. Both ends of the market exist. The same applies to most consumer goods - groceries, clothes, shoes, jewelry, cars, fuel, etc. However, for software, the top end of the market is now non-existent. It's gone the way of expensive secondary market (resale) cars, thanks to how those with hidden defects undercut their price and destroyed consumer trust.

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

#543

Earlier quoted context omitted.

> What I realized is that lower costs, and therefore lower quality, This implication is the big question mark. It's often true but it's not at all clear that it's necessarily true. Choosing better languages, frameworks, tools and so on can all help with lowering costs without necessarily lowering quality. I don't think we're anywhere near the bottom of the cost barrel either. I think the problem is focusing on improv…

You can do this in Scala[0], and you'll get type inference and compile time type checking, informational messages (like the compiler prints an INFO message showing the SQL query that it generates), and optional schema checking against a database for the queries your app will run. e.g. case class Person(name: String, age: Int) inline def onlyJoes(p: Person) = p.name == "Joe" // run a SQL query run( query[Person].filte…

Notice how you're still specifying List types? That's not what I'm describing.

You're also just describing a SQL mapping tool, which is also not really it either, though maybe that would be part of the runtime invisible to the user. Define a temporary table whose shape is inferred from another query, that's durable and garbage collected when it's no longer in use, and make it look like you're writing code against any other collection type, and declaratively specify the time complexity of insert, delete and lookup operations, then you're close to what I'm after.

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

#544
post #422

Earlier quoted context omitted.

But is this cache trustworthy or will it eventually lead you to click in the wrong place because the situation changed and now there's a new button making everything change place? And even if every information takes a bit to figure out, it doesn't excuse taking a second to even draw the UI. If checking bluetooth takes a second, then draw the button immediately but disable interaction and show a loading icon, and when…

As someone who routinely hops between WiFi networks, I've never seen a wrong value here. And OK, we'll draw a tile with all the buttons with greyed out status for that half second and then refresh to show the real status. Did that really make things better, or did it make it worse? And if we bothered keeping all that in memory, and kept using the CPU cycles to make sure it was actually accurate and up to date on the…

Rendering a volume slider or some icons shouldn't take half a second, regardless. e.g. speaking of Carmack, Wolfenstein: Enemy Territory hits a consistent 333 FPS (the max the limiter allows) on my 9 year old computer. That's 3 ms/full frame for a 3d shooter that's doing considerably more work than a vector wifi icon.

Also, you could keep the status accurate because it only needs to update on change events anyway, events that happen on "human time" (e.g. you plugged in headphones or moved to a new network location) last for a practical eternity in computer time, and your pre-loaded icon probably takes a couple kB of memory.

It seems absurd to me that almost any UI should fail to hit your monitor's refresh rate as its limiting factor in responsiveness. The only things that make sense for my computer to show its age are photo and video editing with 50 MB RAW photos and 120 MB/s (bytes, not bits) video off my camera.

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

#545
post #466
post #461

Earlier quoted context omitted.

> I don’t think this leads to market collapse You must have read that the Market for Lemons is a type of market failure or collapse. Market failure (in macroeconomics) does not yet mean collapse. It describes a failure to allocate resources in the market such that the overall welfare of the market participants decreases. With this decrease may come a reduction in trade volume. When the trade volume decreases signific…

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…

Once upon a time, the price of a product was often a good indicator of its quality. If you saw two products side by side on the shelf and one was more expensive, then you might assume that it was less likely to break or wear out soon.

Now it seems that the price has very little to do with quality. Cheaply made products might be priced higher just to give the appearance of quality. Even well known brands will cut corners to save a buck or two.

I have purchased things at bargain prices that did everything I wanted and more. I have also paid a lot for things that disappointed me greatly.

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

#546

Earlier quoted context omitted.

Are you seriously replying and avoiding everything we both said? I'll simplify it for you: Writing dramatically fast software that is 1,000x or even 10,000 times faster than a scripting language takes basically zero effort once you know how to do it and these assembly optimization are a myth that you would have already shown me if you could.

“Zero effort once you know how to do it” is another way of saying “time and effort.” Congratulations you’ve discovered the value of abstractions! I mean, you’re the one who started this off with the insane claim that there’s no tradeoff, then claimed there are no optimizations available below C++ (i.e. C++ is the absolute most optimized code a person can write). Not my fault you stake out indefensible positions.

Your original comment was saying you have to give up features and development speed to have faster software. I've seen this claim before many times, but it's always from people rationalizing not learning anything beyond the scripting languages they learned when they got in to programming.

I explained to you exactly why this is true, and it's because writing fast software just means doing some things slightly differently with a basic awareness of what makes programs fast, not because it is difficult or time consuming. Most egregiously bad software is probably not even due to optimization basics but from recomputing huge amounts of unnecessary results over and over.

What you said back is claims but zero evidence or explanation of anything. You keep talking about assembly language, but it has nothing to do with getting huge improvements for no time investment, because things like instruction count are not where the vast majority of speed improvements come from.

I mean, you’re the one who started this off with the insane claim that there’s no tradeoff, then claimed there are no optimizations available below C++ (i.e. C++ is the absolute most optimized code a person can write).

This is a hallucination that has nothing to do with your original point. The vast majority of software could be sped up 100x to 1000x easily if they were written slightly different. Asm optimizations are extremely niche with modern CPUs and compilers and the gains are minuscule compared to C++ that is already done right. This is an idea that permeates through inexperienced programmers, that asm is some sort of necessity for software that runs faster than scripting languages.

Go ahead and show me what specifically you are talking about with C++, assembly or any systems language or optimization.

Show me where writing slow software saves someone so much time, show me any actual evidence or explanation of this claim.

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

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

A big part of why I like shopping at Costco is that they generally don't sell garbage. Their filter doesn't always match mine, but they do have a meaningful filter.

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

#548
post #507
post #494

Earlier quoted context omitted.

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…

[deleted]

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

#549
post #240
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 market buys bug-filled, inefficient software about as well as it buys pristine software In fact, the realization is that the market buy support . And that includes google and other companies that lack much of human support. This is the key. Support is manifested in many ways: * There is information about it (docs, videos, blogs, ...) * There is people that help me ('look ma, this is how you use google') * There…

So you're telling me that if companies want to optimize profitability, they’d release inefficient, bug-ridden software with bad UI—forcing customers to pay for support, extended help, and bug fixes?

Suddenly, everything in this crazy world is starting to make sense.

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

#550

Earlier quoted context omitted.

You can do this in Scala[0], and you'll get type inference and compile time type checking, informational messages (like the compiler prints an INFO message showing the SQL query that it generates), and optional schema checking against a database for the queries your app will run. e.g. case class Person(name: String, age: Int) inline def onlyJoes(p: Person) = p.name == "Joe" // run a SQL query run( query[Person].filte…

Notice how you're still specifying List types? That's not what I'm describing. You're also just describing a SQL mapping tool, which is also not really it either, though maybe that would be part of the runtime invisible to the user. Define a temporary table whose shape is inferred from another query, that's durable and garbage collected when it's no longer in use, and make it look like you're writing code against any…

The explicit annotation on people is there for illustration. In real code it can be inferred from whatever the expression is (as the other lines are).

I don't think it's reasonable to specify the time complexity of insert/delete/lookup. For one, joins quickly make you care about multi-column indices and the precise order things are in and the exact queries you want to perform. e.g. if you join A with B, are your results sorted such that you can do a streaming join with C in the same order? This could be different for different code paths. Simply adding indices also adds maintenance overhead to each operation, which doesn't affect (what people usually mean by) the time complexity (it scales with number of indices, not dataset size), but is nonetheless important for real-world performance. Adding and dropping indexes on the fly can also be quite expensive if your dataset size is large enough to care about performance.

That all said, you could probably get at what you mean by just specifying indices instead of complexity and treating an embedded sqlite table as a native mutable collection type with methods to create/drop indices and join with other tables. You could create the table in the constructor (maybe using Object.hash() for the name or otherwise anonymously naming it?) and drop it in the finalizer. Seems pretty doable in a clean way in Scala. In some sense, the query builders are almost doing this, but they tend to make you call `run` to go from statement to result instead of implicitly always using sqlite.

Post reply on HN