Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimization tools for C and C++

What tools for Windows and Linux systems can I use to determine alignment issues, cache misses and other parameters relevant to code generated by Visual C++ and GCC? Can I use these tools to determine the alignment of structures so I can avoid compiler-generated padding?

like image 306
Kartlee Avatar asked Oct 10 '22 18:10

Kartlee


1 Answers

To determine cache misses you'll want a CPU-level profiler, like oprofile or vtune, or a dynamic instrumentation tool, like valgrind with cachegrind.

To look for alignment issues on structures, there is a tool called pahole for object files with DWARF debugging information.

like image 190
ninjalj Avatar answered Oct 21 '22 16:10

ninjalj