r/ProgrammerHumor • • 7d ago

Meme buggyCodeReleases

Post image
7.1k Upvotes

242 comments sorted by

View all comments

Show parent comment

437

u/yukichigai 7d ago edited 7d ago

My coworker six months ago: "Code efficiency isn't important, we can just throw more hardware at it."

Today: "We're failing our response time tests because our middleware spends 85% of the limit negotiating a connection."

132

u/cheese_is_available 7d ago

You can now focus on performance and become a hero today. But you're just some guy that make us fail the deadline if you do it before it's actually an issue. Not sarcastic it's just the way human works.

32

u/jelly_cake 6d ago

Premature optimisation being the root of all evil and that. 

31

u/milkybuet 6d ago

Lack of understanding of this quote is actually the root of all evil.

12

u/yukichigai 6d ago

In modern workflow management, without premature optimization there's never any optimization.

1

u/UntestedMethod 5d ago

That's what backlogs are for of course. /s

1

u/quietobserver1 5d ago

A lesson I wish I'd learn for real rather than in theory earlier.

59

u/Major_Fudgemuffin 7d ago

Yeah you can do that until your COGS are through the roof and the system still can't keep up.

I worked for a company processing a few billion events per day, and small inefficiencies add up quick at scale.

6

u/Gabriel_Science 6d ago

What’s funny is that it’s because of AI that hardware is more limited these days, but while we say this, AI doesn’t make super optimised code.

1

u/RoboRouser 4d ago

even better for the guys selling the chips!

8

u/CookIndependent6251 7d ago
let opts;
try {
    opts = JSON.stringify(JSON.parse(opts || '{}'));
} catch (e) {
    // opts was not valid JSON, default to empty object, which means default opts
    opts = '{}';
}

And throw in microservices on top of this.

1

u/p-nguyen_234 1d ago

If negotiation is per request, check connection reuse; if it's startup-only, separate setup from request latency.

1

u/yukichigai 1d ago

I'm not checking anything. They're the ones who said the middleware could do the job, they get to fix it.