User Tools

Site Tools


compiled_c_code_size

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

compiled_c_code_size [2006/11/14 13:15] (current)
Line 1: Line 1:
 +From [[jackchaos]] via [[http://​www.midibox.org/​forum/​index.php?​topic=7959.0|Code Optimization]]
 +
 +From I've been watching my code block size increase steadily as I work on my project and I'm now aware first hand of how assembler can be much more efficient that what a compiler can do.
 +
 +I wanted to share a method I use to determine if my C optimizations are reducing the code size.
 +
 +
 +If you look inside the project.map file, at the top, look for the name of the function you're working on like this:
 +
 +<​code>​
 +S_main__Update_LFO_LED_Status ​      ​code ​  ​0x006304 ​   program ​  ​0x0000fa
 +</​code>​
 +
 +On the end is the size of the function in bytes: 0x0000fa = 250 bytes
 +
 +Every time you compile your source, the project.map will update the starting address of the functions and show the bytes it uses.
  
compiled_c_code_size.txt ยท Last modified: 2006/11/14 13:15 (external edit)