Live data from Hacker News

Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?

beon.tech

11–15 of 15 posts

Re: Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?

#11
post #6

> , performance should be a consideration from the start Don't obsess over this. Obsess over documenting your design decisions - why you decided one algorithm or pattern over another and why. Then _if_ after load testing you need to optimise you'll understand some of the tradeoffs you'll have to make (all decisions are tradeoffs).

Obsessing about it when doing design/architecture but not caring so much in terms of raw implementation seems like a good idea?

Then if you detect inefficiency you can optimize the code and not the architecture.

I am building something with this mindset now, hopefully it will work

Re: Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?

#12
post #10
post #9

Earlier quoted context omitted.

But most organisational failures are not down to performance - they're down to market fit. You don't have performance issues if you don't have a product that people want. :)

I disagree (and have - sadly nonpublic - numbers to prove it). Also, it costs you VERY little to spend some brainpower to design your product to perform well. I honestly really don't understand why so many developers behave like it's physically painful to think for a bit before starting to bash out code. Noone expects you to write microoptimizations, but applying basic knowledge learned in CS classes and knowledge yo…

Agree there's a basic level, and as you say just spend a little time on it but that's table stakes.

My reading of "obsess over it" _is_ micro-optimisations which are a distraction if you've got no market fit

Re: Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?

#13
post #6

> , performance should be a consideration from the start Don't obsess over this. Obsess over documenting your design decisions - why you decided one algorithm or pattern over another and why. Then _if_ after load testing you need to optimise you'll understand some of the tradeoffs you'll have to make (all decisions are tradeoffs).

Obsessing about it when doing design/architecture but not caring so much in terms of raw implementation seems like a good idea? Then if you detect inefficiency you can optimize the code and not the architecture. I am building something with this mindset now, hopefully it will work

I think you're reading something I didn't write.

Nothing to do with architecture - rather ensuring you understand what decisions you're making, what other options you might have and why you're choosing not to do something (eg opportunity costs wrt delivery v time optimising)

Re: Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?

#15
post #8

Rule 1 for performance optimization: measure before trying to make any changes. It’s easy to waste a lot of time and energy optimizing something that isn’t actually going to meaningfully improve your web app’s performance. Personally, I like Sentry. They have a pretty generous free tier and a great code/db tracing tool. (And yes I see that the author lists ‘measure’ as their second point. I think they’re mistaken.)

True, measuring is critical. But if you fundamentally misdesigned your software, measuring won't help you (except to tell you everything is fscked). Having some fundamental skill of designing performant systems is critical on a team.

How do you even know if you fundamentally misdesigned your software?
Post reply on HN