Live data from Hacker News

Ask HN: Will programmers write more efficient code during the memory shortage?

news.ycombinator.com

81–90 of 264 posts

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#81
Programmers will write more efficient algorithms if their employers tell them to trade time-to-market for hardware cost. Previously, it was trade hardware cost for time-to-market.

"Programmers" don't make this decision, the product owner does.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#82
post #27

If that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected. If buyers can't afford the hardware anymore, the studios need to adjust. It's definitively possible to scale games down a lot. There are a few AAA games that were "dumbed down" for the Switch 1 (Hogwarts, cyberpunk, ...). And that's a really low-spec device. There are two factors: existing…

Switch was notorious for having a few Cloud streamed-games that don't run on the actual hardware.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#83
post #82
post #27

If that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected. If buyers can't afford the hardware anymore, the studios need to adjust. It's definitively possible to scale games down a lot. There are a few AAA games that were "dumbed down" for the Switch 1 (Hogwarts, cyberpunk, ...). And that's a really low-spec device. There are two factors: existing…

Switch was notorious for having a few Cloud streamed-games that don't run on the actual hardware.

which ones were those? I want to check them out

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#84
post #77

Earlier quoted context omitted.

“Stop doing stupid stuff” is usually the biggest performance gain in commercial development. We do stupid stuff as a stopgap to meet a deadline and then stupid stuff stays until it starts being a problem.

There's nothing more permanent than a temporary fix. If deadlines are causing those stopgaps, the aggressive deadlines are the root problem.

In my experience, many of those deadlines are commonly the only reason the company continues to exist as well.

The root of the problem is much more deeply ingrained in our economic system.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#86

Some programmers will write more efficient code. At my $dayjob (one of the big tech companies) we're already planning a major goal next year of optimizing server code to reduce RAM requirements, and this is directly in response to the crunch. In practice I expect most optimizations will come from "stop doing stupid stuff" and not "use fancy advanced algorithms." But that's a cynical perspective so don't be cynical li…

even a lot of the fancy algorithms are ways to not do something you dont need to do, it's rooting out waste all the way down.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#87
post #77

Earlier quoted context omitted.

“Stop doing stupid stuff” is usually the biggest performance gain in commercial development. We do stupid stuff as a stopgap to meet a deadline and then stupid stuff stays until it starts being a problem.

There's nothing more permanent than a temporary fix. If deadlines are causing those stopgaps, the aggressive deadlines are the root problem.

Honestly, after years of seeing this play out, a lot of devs really lack the judgement to know when something is good enough to deliver and will endlessly delay projects to “ do the right thing”

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#88
post #27

If that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected. If buyers can't afford the hardware anymore, the studios need to adjust. It's definitively possible to scale games down a lot. There are a few AAA games that were "dumbed down" for the Switch 1 (Hogwarts, cyberpunk, ...). And that's a really low-spec device. There are two factors: existing…

I hope we continue local gaming, but my gut tells me we are going to see the opposite. I'd be willing to place a big bet on the new XBox leaning heavily into streaming, like GeForce now. Studios still get to build big, and the consoles get to rent hardware to you now, basically a wet dream for them. hardware costs must come down or every consumer segment is going to be renting, not owning, everything.

> hardware costs must come down or every consumer segment is going to be renting, not owning, everything.

Is this not exactly what companies want

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#90
> Will programmers write more efficient code during the memory shortage?

Yes. No. Yes.

I've worked in gamedev, helping ship code that ran on consoles. Nice fixed hardware targets. You OOM, you crash. We crashed a lot, and cut and saved and optimized and explicitly invoked the garbage collector twice on level transitions, because a single full scripting language GC doesn't work when finalizers must run to deref C++ objects to unroot script objects, and committed other horrific hacks.

The memory shortage may eventually impact fixed targets like this. Or the minspec publishers will swallow for fuzzier targets like "PC". But it takes awhile for new targets to roll out, and for newly bought PCs to make a significant dent on total percentage of PC ownership. Steam Machine's about to release with 16+8GB and while price and market saturation may be affected by the memory shortage, I'd be suprised if the actual spec changed.

> Maybe there will even be more interest in the invention and use of more advanced algorithms

Not for typical gamedev IMO. There the focus will be more on "reduce the amount of content loaded in memory simultaniously". That means less detail, smaller scale, or less variation. Going from 4096x4096 to 2048x2048 textures quarters your texture memory usage. The surface of meshes also has some square density nonsense going on. Basic animation tends to scale with bone count and keyframes, which are more linear, although shape keys are more per-vertex nonsense.

And of course, reusing the same mesh or texture multiple times doesn't use more memory, just more memory bandwidth.

Audio is more a factor of "how many sound effects (and variants) do we need preloaded just in case there's suddenly an event that triggers them".

These are the big ticket items for memory use and advanced algorithms don't help much. Rather, the algorithms help stretch whatever amount of memory you do have to provide the best amount of quality you can, and the small constant shift in total memory availability doesn't change the calculus for how important that is very much (which depending on the game ranges from "unimportant, everything fits in memory easily" to "critical, we're doing open world streaming and we've got terrabytes of raw data already, 16 vs 64GB of memory doesn't change that much")

> and data structures that use less memory?

Some bit packing type stuff comes up for smaller logical data structures in gamedev, and that can be useful for saving memory bandwidth, but I'm skeptical of how critical it is for total memory usage outside of the occasional Factorio.

Post reply on HN