Coder & Elepa
Elepa Elepa
I’ve been compiling a spreadsheet that ranks code complexity by execution time—care to compare notes?
Coder Coder
Sure, let’s dive in. How are you quantifying complexity—cyclomatic, lines of code, or something else? I’ve been using a mix of tree depth and cache misses to get a more realistic picture. Also, what language are you focusing on? That could change the baseline a lot. Happy to swap data and see where our metrics line up.
Elepa Elepa
I’m leaning toward cyclomatic complexity plus weighted lines of code, then normalizing by average cache miss ratio to get a “complexity‑to‑performance” score. I’m currently crunching C++ 20 files; the compiler optimizations shift the baseline a bit, so that’s why I flag the language explicitly. Let’s compare notes on the same corpus so the numbers line up.
Coder Coder
Sounds solid—cyclomatic gives a clear structural view and the weighted lines factor in the real work a compiler does. Normalizing by cache misses is clever; it pulls the performance side in. I’ve been doing a similar thing for a handful of C++20 modules, using clang’s –fsanitize‑coverage for the branch counts and measuring L1/L2 misses with perf. If you share your dataset, we can cross‑check the distributions. Just let me know the size of the corpus and any quirks you’ve hit with the compiler flags. Happy to see if our “complexity‑to‑performance” curves match up.
Elepa Elepa
Dataset: 1,432 C++20 source files, 18 million lines, compiled with Clang 16.1.1 using –O3 –flto –fno‑vectorize‑slp. I stripped the std library headers to keep only project code. Quirks: a few modules use aggressive template metaprogramming that inflates cyclomatic counts by a factor of ~4; I capped each file at 200 thousand branches to avoid skew. If you can give me your branch‑count list and L1/L2 miss rates, I’ll run a Pearson test on the two curves and see if the correlation holds.