this post was submitted on 21 Dec 2024
36 points (100.0% liked)
Programming
17668 readers
132 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Nice article. For the optimization related ones there’s a good rule of thumb: it’s not an optimization if you don’t measure an improvement.
This, so much. I often see this at work, theories about this and that being slow, or how something new « should » be better. As the resident code elder I often get to reply « why don’t you measure and find out »…
For some reason it seems nobody uses sampling profilers anymore, those tell you exactly where the time is spent, you don’t have to guess from a trace. Optimizing code is kind of a lost art.
Sometimes I wish compilers were better at data cache optimization, I work with C++ all the time but all of it needs to be done by hand (for example SoA vs AoS…). On the upside, I kind of have a good job security, at least until I retire.
I hate when coworkers tell we should do thing in a particular way because it’s ”better”. We try the thing and there’s no measurable difference. Well, it was a good idea in their mind, so it must be an improvement. Therefore, they insist it should be kept, even if it makes the code extra convoluted for no reason at all.
And yes. Profiling is great. Often it is a surprise where most time is spent. Today there’s few excuses not to profile since most IDEs have good enough profiler included.