Earlier quoted context omitted.
> it won't show up in profiles except for ones that capture stacks I don't think I've ever used a profiler that couldn't report you were in F() here. One that only captures your innermost functions really doesn't seem that useful, for exactly the reasons you give.
The default usage of perf does this. There's also a few profilers I know of that will show the functions taking the most time. IMO, those are (generally) nowhere near as useful as a flame/icicle graph. Not saying they are never useful; Sometimes people do really dumb things in 1 function. However, the actual performance bottleneck often lives at least a few levels up the stack.
Performance optimization is hard because it's fundamentally a brute-force task
111–120 of 153 posts
Re: Performance optimization is hard because it's fundamentally a brute-force task
#112Earlier quoted context omitted.
Do you want to claim you've never written quick and ugly code to get something working to come back and fix it up later? Pretty much everyone I know will throw down an O(n^2) algorithm or whatever in their first pass and replace it with something more thought out once they have the time to think deeply about it. If you're fretting about optimization at every stage of development, you're really doing it wrong. This is…
> Pretty much everyone I know will throw down an O(n^2) algorithm or whatever in their first pass and replace it with something more thought out once they have the time to think deeply about it. Most of the times I've seen this, the faster algorithm is literally just a dictionary with a well-defined key. I honestly do not understand why that's not the first solution most devs think of and why n^2 seems to dominate. A…
Re: Performance optimization is hard because it's fundamentally a brute-force task
#113I have almost always found that simple code runs faster than complex code. I think this is because optimization is likely an NP problem and like all NP problems, the best algorithm we have for solving it is divide and conquer. The core thing about D&C is that you divide until you reach a level that you can actually find the optimum answer within the resources given but accept that by dividing the problem you will lik…
They are very much not the simplest possible implementation of the algorithm and they run an order of magnitude faster for some algorithms.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#114Being how I fall under any developer, I'm going to bite the bullet and ask:
How are they supposed to be equivalent? One is a HashSet, other is boolean? And what is `c`.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#115I once had this kind of body recovery/stress level measuring thingy on me for a few days, and a doctor would then analyze my health and such. I was under some stress those days and (according to the measurements) I wasn't recovering properly even during the nights. But then there was this one, long, flat, deep green curve in the middle of my work day. I checked from my VCS what I was doing during that period: I was o…
I try to keep a few of these tasks lying around marked “unblocked” in case I need to unwind. It keeps me from doing it right after noticing, which is an extra bonus.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#116I once had this kind of body recovery/stress level measuring thingy on me for a few days, and a doctor would then analyze my health and such. I was under some stress those days and (according to the measurements) I wasn't recovering properly even during the nights. But then there was this one, long, flat, deep green curve in the middle of my work day. I checked from my VCS what I was doing during that period: I was o…
1. Tracking i.e. navigating through jungles for hunting or find where the bottleneck is.
2. The thrill of the hunt. The joy after finding the hotspot or the bottleneck. It makes your day.
3. The actual hunt i.e. shooting an arrow/spear or using clever way of fixing.
4. Brag about the hunt or writing a blog post or tech talk on how difficult and awesome the hunt was.
Also optimizing a critical path has multiple takers in the org:
1. Product Managers are happy due to improved user experience.
2. Management is happy as in some cases it actually saves a lot of money.
3. Your boss is happy because he/she gets to score points as "team achievement" when evaluation is around the corner.
4. Engineers get to do nerdy things which otherwise would not find traction in the org.
All in all its a win-win-win-* situation.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#117Earlier quoted context omitted.
The default usage of perf does this. There's also a few profilers I know of that will show the functions taking the most time. IMO, those are (generally) nowhere near as useful as a flame/icicle graph. Not saying they are never useful; Sometimes people do really dumb things in 1 function. However, the actual performance bottleneck often lives at least a few levels up the stack.
Which is why the defaults for perf always drive me crazy. You want to see the entire call tree with the cumulative and exclusive time spent in all the functions.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#118Optimizing AI performance is like peeling an onion — every time you remove one bottleneck, another layer appears underneath. What looks like a compute problem turns out to be a memory bottleneck, which then turns out to be a scheduling issue, which reveals a parallelism mismatch… and so on. It’s a process of continuous uncovering, and unless you have visibility across the whole stack — from kernel to cluster — you’ll…
Re: Performance optimization is hard because it's fundamentally a brute-force task
#119I'll throw my hat in the ring for "disagree". Few kinds of work have such clear and unambiguous results as optimization work (its now X% faster!). Few kinds of work have such incredible and detailed tools to guide your hand in finding where to invest your effort (look at this hot loop!). The fact that sometimes optimization work is tricky or requires some pre-thinking, or is even gasp counter-intuitive is such a hila…
Re: Performance optimization is hard because it's fundamentally a brute-force task
#120> Any developer can see that the following two snippets are (supposed to be) equivalent Being how I fall under any developer, I'm going to bite the bullet and ask: How are they supposed to be equivalent? One is a HashSet, other is boolean? And what is `c`.