6 ms·
> So making your code 100x faster saves you more than 100 servers. Yeah, but "making your code 100x faster" might cost significantly more than just adding 100
by nmfisher 6y ago
> So making your code 100x faster saves you more than 100 servers.
Yeah, but "making your code 100x faster" might cost significantly more than just adding 100x servers.
As with most things, the only absolute rule is "it depends".
- bryanrasmussen 6y agocode has a bigger upfront cost but after the initial investment it's all profit. Servers can also go down, but the 100x faster code will remain the same.
- mrmrcoleman 6y agoIf the code has been optimized to the point of being illegible/difficult for others to maintain then, assuming you’d like to update that code at some point, you’ll need to pay for that too.
- midrus 6y agoThat's under the assumption that code doesn't have to be maintained, updated with new features, and that writing it on any programming language has the same cost. Otherwise we would all be writing assembler. Humans are way, way more expensive than servers in almost every case. Exceptions might be small pieces of code ran by millons of devices, but that's far from being the common case.
- otabdeveloper4 6y agoAssembly is expensive because you have you re-write your code every time your architecture changes.
- makapuf 6y agoArchitecture (x86_64 or arm on mobile) hasnt changed in decades. The way to optimize for it changes in years but you get a slightly less optimized version. Im sure software written in 2007 in assemble for linux pc works now, and fast. I think assembly is not cheap because the language is tiny, offers no abstraction and youre on your own for everything, not because of arch turnover.
- satyrnein 6y agoMost likely, squeezing 100x performance out of your code will significantly complicate it. For example, you're probably going to be dealing with cache invalidation a lot, and you will pay for that complexity forever, as you try to build new features.
- ficklepickle 6y agoIt depends on the baseline, I suppose. I could see code written (poorly) in a dynamic language to be 100x slower than necessary. Maybe it was fast enough when written, so nobody looked too hard. Inefficient DB queries, excessive IO. But I agree with the sentiment. In a code base where performance matters, that level of optimization would often be impractical.
- throwaway189262 6y agoIt depends. In many benchmarks Java is 50X faster than Ruby. So having code 100X as fast can just mean choose a fast language and framework for your project
- corty 6y agoadding 100 servers damages the environment 100x more and costs jobs. There should be no question that optimization is the responsible thing to do, just buying servers is wasteful, greedy and irresponsible. We need a commitment from all the (supposedly) environmentally conscious SV companies to pick optimization if given a choice between making the software faster and just throwing more computers at it. That would be relevant and meaningful, not just the usual "our office AC isn't set as cold as possible, so we are green"
- AntiImperialist 6y agoNo, it definitely doesn't have that direct impact on environmemt. If you're using cloud servers, what it costs to you is not always connected to how many physical servers are running. On top of that, AWS, for example, claims to use renewable sources for over 50% servers. Moreover, there are other considerations. If you're spending too much time on optimization, the company may not survive... leading all the work done to potentially go to waste. What about the environmental impact of waste there?
- Raphael_Amiard 6y agoI'm not sure why you are being downvoted, that sounds pretty reasonable to me. The idea that we'll have to make (at least) this level of compromise to survive as a species seems to still not be taken seriously in the tech world.
- corty 6y agoI can sympathize with downvoters, demanding change is always easier when the demand is aimed at others, not yourself or your peergroup. And I'm not sure if this level of compromise is really necessary, or if optimizing computer power consumption is just negligible on a global scale and the resources spent to optimize here (it will cost money after all, even if the initial investment pays later on) would be better spent elsewhere. My comment was aimed more at the hypocrisy of claiming to be green and then skipping the obvious savings in optimizations.
- nmfisher 6y ago
- otabdeveloper4 6y ago> Yeah, but "making your code 100x faster" might cost significantly more than just adding 100x servers. Cost? No. But it certainly requires more talent. Unfortunately, programming talent doesn't scale with cost at all. In that it's like a creative endeavor: you can hire 10000 "professional writers" if you want, but that won't get you another Shakespeare. Which is why I find the "software engineer" moniker silly. Software isn't at all like engineering.
- boffinism 6y agoFwiw engineering talent doesn't scale with cost either. What you've described is actually one of the areas software and engineering are similar, not divergent.
- choeger 6y agoThat has nothing to do with talent IMO. Every software engineer worth their salt should be able to inspect a full stack, measure and evaluate the performance. Instead you have 80% people stuck in whatever the current fashion is (js, I look at you) and that cannot tell a png from a .so . So in the end, it is more about attitude, not talent.
- otabdeveloper4 6y ago> software engineer worth their salt... ...is a scotsman that doesn't exist.
- freshhawk 6y agoAgreed. When we focus on the part of the spectrum of optimizations that do require talent, we're thinking of the exceptional, interesting, makes-a-viral-post-on-HN stuff. The bulk of the work, in my experience, is simpler than the programming part. It's just a culture/priority thing. Like how most of the industry used to not use source control. Now we do, we didn't need to add "talent" to get that done either.
- vendiddy 6y agoI agree. One heuristic is the specs of our computers 20 years ago had. Those computers were an order of magnitude slower. Yet many equivalent apps today run at about the same speed. Performance is not being prioritized. And I suppose back then, devs had no choice given the resource constraints they had. I've seen many times devs paying for larger databases instance without first even taking a few hours to try and optimize their queries.