Performance optimization is hard because it's fundamentally a brute-force task
1–10 of 153 posts
Re: Performance optimization is hard because it's fundamentally a brute-force task
#2Re: Performance optimization is hard because it's fundamentally a brute-force task
#3Strategic optimisations is often basically free if you have domain expertise. It's that easy to know that the business wants x outcome and algorithm y is the right choice etc if its all internal thought processes. Whereas if you don't know enough then you're likely to make very expensive to undo decisions.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#4An interesting aspect is data dependencies. If your next statement reuses data you just computed, that can cause pipeline bubbles, as that result you want to use just isn't available yet. I dived into that topic for a video about relative performance of old PCs I just published today.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#5Re: Performance optimization is hard because it's fundamentally a brute-force task
#6I think it is worth making a distinction between "micro" (what the blogpost is about) and "macro", or "tactical" and "strategic", optimisations. Strategic optimisations is often basically free if you have domain expertise. It's that easy to know that the business wants x outcome and algorithm y is the right choice etc if its all internal thought processes. Whereas if you don't know enough then you're likely to make v…
Re: Performance optimization is hard because it's fundamentally a brute-force task
#7Re: Performance optimization is hard because it's fundamentally a brute-force task
#8Re: Performance optimization is hard because it's fundamentally a brute-force task
#9> There is no way to provide both optimized assembly and equivalent C code and let the compiler use the former in the general case and the latter in special cases.
This is true, but can be seen as a failure of language and tooling. For example, Halide [1] pioneered (AFAIK) the concept of separating algorithm from implementation at the language level. This separation lets you express the algorithm once, and then "schedule" it by specifying parallelism, vectorization, etc. You can provide multiple schedules for one algorithm, which allows you to specialize / make different choices depending on varying factors.
It's a really interesting concept, though maybe limited in practice to DSLs. I'm not sure a general purpose language would be a good fit for this model, but then, for general purpose programs written in general purpose languages, perf optimization at the level TFA discusses is frequently limited to just specific hot sections. Those hot sections could be extracted out into specialized components written in such a DSL.
Re: Performance optimization is hard because it's fundamentally a brute-force task
#10Good article that I agree with mostly. One interesting note is this: > There is no way to provide both optimized assembly and equivalent C code and let the compiler use the former in the general case and the latter in special cases. This is true, but can be seen as a failure of language and tooling. For example, Halide [1] pioneered (AFAIK) the concept of separating algorithm from implementation at the language level…
https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning....