[hatari-devel] Profiling Hatari code with Valgrind

Eero Tamminen oak at helsinkinet.fi
Wed Jan 5 21:47:28 CET 2011


Hi,

On tiistai 04 tammikuu 2011, Laurent Sallafranque wrote:
> I've given a closer look at the 2 valgring png's that Eero sent us
> (30lcoke and wildfire).
> I've seen that dsp_update_e_u_n_z() is one of the most often called
> functions.
> (nearly every other DSP instruction). If you cumulate all the calls, it
> takes a certain time.

Those programs were very simple 4kB ones so that bottleneck isn't
necessarily the worst or common one DSP has...

I think it would be best first to collect list of programs which make Hatari
to use most CPU (or e.g. skip most frames if CPU is at max) and profile
those to see whether there are common bottlenecks.

Has anybody noticed some DSP utilizing Falcon programs to tax Hatari
more than other such programs?


The Julia fractal part in the beginning of wildfire.prg is pretty bad, it
uses 90% of CPU even on my new computer and causes autoframeskip of 2
even when I have sound disabled and use "-z 1" option to minimize screen
redraws.


> I've given it a full rewrite. Can somebody test it and see if this
> increases speed again ?

Not really noticeably for these two demos.  I think the larger CPU usage
spike at the end of Julia fractal in wildfire.prg isn't as bad as earlier,
but otherwise it seems to be <1% difference.

(I think branches are more expensive than simple calculation operations,
than may explain why it didn't help noticeably.)


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.


> I wish all these updates accelerates DSP a little for slower computers.


	- Eero



More information about the hatari-devel mailing list