332
Software is slow because of bad design, not slow languages
(www.seangoedecke.com)
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
Follow the wormhole through a path of communities !webdev@programming.dev
Has everyone forgotten the art of creating or using performance profiling tools
I was in a meeting with a senior software engineer, who makes a shit ton more than me. While sharing my screen he saw flame graph I had for one program I was working on. They asked "what is that?", I was taken back, and said it's for looking at which functions are taking more time. Then I was asked "where did you find it?" I was shell shocked, didn't know how to answer that. Similar things have happened before where I taught them certain things, and they go "great find", like dude, I didn't find it just now. That's basic knowledge if you work with database.
I am not even a developer hire, I'm self learned, and because the company doesn't have many developers they gave me some of the tasks and I'm doing it because it's more fun than my job responsibilities, and when I don't have enough tasks.
Ive used them to help a lot in the past, but they often didnt give enough detail. Like I would know the area something was a problem, but pinpointing exactly what it was was still up to me, and would take some time. It worked but it could have been better.
Turns out there was a library you can add which adds that extra missing detail, and with that it was possible to highlight the exact issue. Wish id known about that sooner. That was on me though.
Flame graphs have really only been a thing for the last decade or so. The free tooling for profiling code has been shitty and difficult to understand for most of my career. And most companies aren't willing to pay for it if the product runs "good enough". These days companies lock down their shit so tight that you can't even install an unapproved app no matter how free or useful.
I think that's true for many tools. Programming tools are the one thing that has most advancement because so many programmer are there to improve on them. And even if you don't use it, not knowing about it completely makes it a bit odd. Although most tools I have used to make flamegraph were as easy as just running the program as a argument to another program that tracks the function calls.
You see, performance is rarely a talking point in retrospectives unless its egregious. If you say a piece of compute is struggling the solution is to always buy more compute. It is rare that anyone would think of optimization unless you're writing libraries.
I think that's one of the problem with people that are only of a "finish this task cheaply for now" mind.
Having something run in 0.1 second vs 1 second is fine when a user is running it for one thing. So they consider it good or instantaneous. And later they have to do it for 1000 other things, and they don't think that saving time in that "instantaneous result" there would save so much more time. They just go "it's 1000 of these so it takes time". I've found functions that open a db file, read one entry and close it. Then that function is called for each entry they have to read later. In a preprocessing step where they know all the entries they need beforehand. And even the data tyoe to store it is nor preallocated, they just append it on every data read; again on a fixed number of entries they need.
I understand performance not being the most important thing, but I'd expect least a basic understanding of design that has unnecessary processing.
Or if its employee facing only let it get slower and slower to the point where it takes a minute to update one record
Which is exactly why western AI companies are bankrupting themselves building data centers while China is easily keeping pace with a fraction of the resources. They're not magic. They just do basic things like make things more efficient.
Pay me to do it and I'll gladly do it. Most companies, however, don't really care much about whether the customers take an extra 100 milliseconds for every request or not. And when it's promotion time, you're often judged by how many tasks you get done, not how fast your code is.