[hatari-devel] Profiling Hatari code with Valgrind
Eero Tamminen
oak at helsinkinet.fi
Wed Jan 5 22:19:12 CET 2011
Hi,
On keskiviikko 05 tammikuu 2011, Eero Tamminen wrote:
> Best would be if you use a memory snapshot and the Hatari timing
> functionality (--run-vbls option + very large frameskip with
> fast-forward) for checking speedup.
You could start just by adding some main() loop around the function
which calls it a million times in a row while changing DSP register values
and "time" how long that takes. If the function takes longer, it's not
faster. :-)
Note that the main loop should be in a separate c/object file with
other require stuff from dsp_core.c so that GCC doesn't optimize some
of the things away like it could if you put them to same file.
Sometimes it also helps to look at what kind of asm code GCC optimizations
generate for your C-code (I don't understand x86 asm much, but at least
I can see if the code is significantly shorter/longer :)).
- Eero
More information about the hatari-devel
mailing list