News for hackers. Stuff that matters.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by nmfisher on Friday November 20, 2020 @11:42PM (#25167911)
> 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".

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by corty on Saturday November 21, 2020 @03:20AM (#25168475)
adding 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"

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by nmfisher on Saturday November 21, 2020 @06:50AM (#25169175)
I mean, as a general expectation, that’s ridiculous. Businesses will always optimise for profitability, expecting them to eat their margin voluntarily for environmental concerns is unlikely to be a solution.

As a policy, though, it makes sense - tax the environmental externalities appropriately to reflect the actual shared cost. If it’s still economic to add the servers once those costs are factored in, then you wouldn’t have any grounds to complain.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by corty on Saturday November 21, 2020 @08:37AM (#25169665)
Problem is, taxing electricity appropriately shuts down your whole economy. Prices would need to be sky-high before SV would feel the squeeze, till then mom and pop wont be able to run their electric hob and your neighbourhood steel smelter will move to china even faster. Taxes may seem like an easy solution, but if you look closely it is far more complex.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by danheskett on Saturday November 21, 2020 @09:01AM (#25169763)
There's nothing saying you have to tax the first watt like the millionth watt.

Just design the tax regime so that it is high usage users who are paying the high costs, and exclude any usage levels that would impact homes, small businesses, and "normal" acceptable uses.

I agree that tax policy is more complex than just "tax the shit out of it", but everytime a tax is proposed, there comes a group of people who argue that taxation is so complex that we can't possibly grok it. That is clearly not the case.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by corty on Saturday November 21, 2020 @10:43AM (#25170264)
Everytime a tax is proposed, people like me suggest to look at the German Energiewende. Small businesses and private homes are taxed to hell and back on electricity, to keep prices for large businesses internationally competitive, because those bussineses can just pack up and go elsewhere. Or cause a revolution when going bancrupt. Taxing large consumers more also doesn't work. Taxes are never the single answer, you always need to combine them with import duties, ending trade agreements, leaving the WTO, maybe even leaving the EU to be able to levy duties on other European countries with a lesser energy tax. Because that is what it takes to create a fair tax regime on energy.

I guess only the very radical greens would want to stomach that backlash...

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by Raphael_Amiard on Saturday November 21, 2020 @04:39AM (#25168700)
I'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.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by corty on Saturday November 21, 2020 @05:29AM (#25168892)
I 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by AntiImperialist on Sunday November 22, 2020 @03:35AM (#25175941)
No, 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?

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by otabdeveloper4 on Saturday November 21, 2020 @03:27AM (#25168493)
> 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by doctor_eval on Saturday November 21, 2020 @05:18AM (#25168842)
The term “software engineer” was invented to describe the work being done by Margaret Hamilton and her team, when developing the guidance software for the Apollo moon landings. It definitely is a form of engineering.

From Wikipedia:

> When I first came up with the term, no one had heard of it before, at least in our world. It was an ongoing joke for a long time. They liked to kid me about my radical ideas. It was a memorable day when one of the most respected hardware gurus explained to everyone in a meeting that he agreed with me that the process of building software should also be considered an engineering discipline, just like with hardware. Not because of his acceptance of the new 'term' per se, but because we had earned his and the acceptance of the others in the room as being in an engineering field in its own right.

https://en.wikipedia.org/wiki/Margaret_Hamilton_(software_en...

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by jhgb on Saturday November 21, 2020 @08:10AM (#25169529)
> The term “software engineer” was invented to describe the work being done by Margaret Hamilton and her team, when developing the guidance software for the Apollo moon landings.

There's a considerable debate about when and where this term was "invented", apparently with some oral histories placing it even into (late?) 1950s.

As for grandparent's comment, I think it was referring to the fact that the nature of the job is completely different. For example a large portion of a traditional engineer's job deals with fighting the natural world. A bolt may rust away and stop doing what it was doing until then. A source code line in the form of

  a=a+7; 
won't do any such thing. As long as it exists it will keep doing the same thing. Hence software engineers have to deal with a completely different set of issues, to the extent that calling it "engineering" is to a certain extent metaphorical.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by heelix on Saturday November 21, 2020 @08:55AM (#25169741)
Code rots/rusts faster than most physical objects. Requirements change, libraries update at a breakneck speed. I've had to deal with some (functional) languages that don't allow you to change the the variable where some would allow that sort of modification just fine for your simple example. Change is everywhere.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by jhgb on Saturday November 21, 2020 @09:37AM (#25169940)
> Code rots/rusts faster than most physical objects. Requirements change, libraries update at a breakneck speed.

That's a forced metaphor as well, not actually an identical process. If "requirements change", that's not the same thing as a bolt rusting away. Surely the requirements for the rusting bolt didn't change, or the requirements for its "dependencies", i.e., the things it's attaching together.

> I've had to deal with some (functional) languages that don't allow you to change the the variable where some would allow that sort of modification just fine for your simple example.

I completely fail the relevance of that. Or maybe it is somewhat relevant, but in the completely opposite way, i.e., that this phenomenon does not even have an analogy in the physical world, thus underlining the vast differences between software engineering and classical engineering disciplines. (Likewise the dichotomy between a computational procedure and the process generated by said procedure, the latter being constrained in the way you describe, doesn't exist in traditional engineering either.)

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by choeger on Saturday November 21, 2020 @03:55AM (#25168573)
That 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by freshhawk on Saturday November 21, 2020 @06:35AM (#25169122)
Agreed. 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by vendiddy on Saturday November 21, 2020 @10:15AM (#25170136)
I 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by xxpor on Saturday November 21, 2020 @10:42AM (#25170262)
The depressing part of all of this is performance optimization is really fun! I love sitting down with flamegraphs and other profiler output and making things faster.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by otabdeveloper4 on Sunday November 22, 2020 @06:52AM (#25176744)
> software engineer worth their salt...

...is a scotsman that doesn't exist.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by Hamuko on Saturday November 21, 2020 @04:10AM (#25168628)
>Cost? No. But it certainly requires more talent.

Talented people usually cost a lot to optimize your code to be faster. And the more time they spend optimizing existing code, the less time they spend writing new code.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by t-writescode on Saturday November 21, 2020 @05:25AM (#25168874)
The more time they spend potentially unlocking the ability to write new code, though.

And faster code in existing places can unlock new business opportunities which can unlock more money.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by boffinism on Saturday November 21, 2020 @03:30AM (#25168499)
Fwiw 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.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by nmfisher on Saturday November 21, 2020 @06:56AM (#25169201)
I’m not sure what you’re talking about. I’m not going to ask my developer - who I pay $2000 a day - to spend 10 days optimising my codebase to avoid an extra $5000 in server costs.

It doesn’t matter if they’re a 10xer or a 1xer, their time always has a price tag.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by jimnotgym on Saturday November 21, 2020 @07:06AM (#25169245)
That doesn't fit in my accountant's brain at all. $20k one off cost vs $5k recurring cost could mean anything if you omit the time period! $5k a year depends on your cost of capital, $5k per month is a no brainer
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by cj on Saturday November 21, 2020 @07:55AM (#25169441)
The way I read the comment is $20k cost for a dev to optimize vs. $5k / yr cost in server, making it 4 years until you break even.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by jimnotgym on Saturday November 21, 2020 @09:22AM (#25169868)
It is still not clear if that is a good or a bad thing. It depends on your circumstances
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by Hamuko on Saturday November 21, 2020 @09:11AM (#25169823)
>who I pay $2000 a day

American salaries sound great.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by Jtsummers on Saturday November 21, 2020 @09:52AM (#25170017)
That’s not a typical American salary. $250 per hour is specialist pay, consultant pay, or overpaid.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by Qwertious on Sunday November 22, 2020 @07:17AM (#25176863)
That's $730 000/year assuming work every day, and $500k assuming 5 days a week plus $30k for holidays.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by timkofu on Saturday November 21, 2020 @11:17AM (#25170483)
Engineering is using science to build technology, using engineering principles that are common to all engineering disciplines. Software Engineering is using engineering engineering principles to build software.

Project management methodologies like scrum are implementation level details, together with platform (user interface, programming language, database e.t.c). Software Engineering starts at the feasibility study, followed by detailed design, then comes the implementation phase. Most Software Engineering job posts only list implementation phase requirements, which I reckon has led to SE being misunderstood.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by lultimouomo on Saturday November 21, 2020 @04:24AM (#25168667)
I don't think 100x more structural engineers can make a bridge with a hundred times longer span either.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by bryanrasmussen on Saturday November 21, 2020 @02:01AM (#25168272)
code 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by satyrnein on Saturday November 21, 2020 @07:02AM (#25169227)
Most 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.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by ficklepickle on Saturday November 21, 2020 @11:01AM (#25170360)
It 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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by throwaway189262 on Saturday November 21, 2020 @01:27PM (#25171609)
It 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
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by midrus on Saturday November 21, 2020 @03:19AM (#25168473)
That'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.

Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by otabdeveloper4 on Saturday November 21, 2020 @03:46AM (#25168546)
Assembly is expensive because you have you re-write your code every time your architecture changes.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by makapuf on Saturday November 21, 2020 @04:42AM (#25168715)
Architecture (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.
Re:Optimizing Your Web App 100x Is Like Adding 99 Servers by mrmrcoleman on Saturday November 21, 2020 @02:44AM (#25168377)
If 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.