Ask HN: Got any tips for profiling and tuning C?
We use an open source tile rendering engine that's entirely written in C. My goal is to identify it's data access patterns. This will help me determine which functions need to be optimized, or how to reorder the data on disk to to optimize for those data access patterns.
I'm going to eventually end up reading the whole codebase, but I'm certain that there are best practices for determining this kind of information that I am just unaware of. I'm vaguely familiar with gdb and valgrind, but I feel like I'm only scratching the surface of their capabilities.
What kind of tooling is everyone else using these days? My specific use case is on linux, but I'd appreciate tips across the board.
I'm also interested to see if recompiling with llvm and clang would give me any performance increase. I see there are malloc replacements like tcmalloc and hoard. Does anyone have experience with these?