Bytes before FLOPS: your algorithm is (mostly) fine, your data isn't

bitsdraumar.is

33 points by bofersen a day ago


VorpalWay - 18 minutes ago

To the list of profiling tools I would like to add KDAB Hotspot and KDE Heaptrack.

The former, hotspot, is a visualiser for perf data, and it deals ok with truly massive files that made perfetto and similar just big down. It also supports visualing off-CPU profiles ("why is my program slow but not CPU bound?").

The latter, heaptrack, is a tool with very similar UI to hotspot (I think the two tools share some code even) to profile malloc/free (or new/delete). Sometimes the performance issue is as simple as not reusing a buffer but reallocating it over and over inside a loop. And sometimes you wonder where all the memory is going.

colonCapitalDee - a day ago

Great article. Can confirm, writing performance focused C# is fun. It's great having the convenience of async, LINQ, and GC for writing non-hot path "control plane" code, then pulling out Vector<T>, Span<T>, and so on for the hot path.

One question, how portable are performance benefits from tweaks to memory alignment? Is this something where going beyond rough heuristics (sequential access = good, order of magnitude cache sizes, etc) requires knowing exactly what platform you're targeting?

jmole - a day ago

> worst case scenario being the flat profile where program time is roughly evenly distributed

It sounds like the “worst case“ here is that the program is already optimized.