Reputation: 147
I have test.exe, without source code, but with debug information, and optimized for intel generic.
Do you know any tool, that lets you optimize your executable? e.g.: I want to optimize the exe for core 2 duo, for smaller caches, remove debug information etc.
I think disassembly and recompile with gcc would do it, but anyone did something like this? Do I gain some performance? [Edit] - disassembly and recompile most likely won't work.
Upvotes: 2
Views: 216
Reputation: 365342
AFAIK, there's nothing you can do to make it run faster.
It'd be worth trying a decompile / recompile. You might get something that still works, and maybe something will be vectorizable. But I think probably not.
To optimise code, a compiler needs to know which behaviour is a requirement for the program to do what's desired, and which behaviour is just an artefact of the specific instructions chosen by the original compiler. The information to know what's important and what isn't is basically lost in the noise of the x86 machine instructions.
Maybe there'd be some peephole optimisations like replacing a sequence of SSE2 instructions with a single SSSE3 one, or something, but probably nothing significant.
You can make the binary smaller with strip
, but the debugging info doesn't even get loaded into memory when you run the exe. It's in its own section, so the debugging info isn't mixed in with code/data/needed symbols, and thus doesn't dilute cache density. It only matters when copying the executable around.
Upvotes: 2