Hi all,
I wanted to share a new little tool I built in the context of my cc64 development, a small profiler. It's built for C64 VolksForth and uses an extended NEXT routine that sorts NEXT invocation counts and the time spent between each NEXT iteration into one of up to 8 buckets, memory ranges in the dictionary, that can be flexibly defined to cover either large areas, whole modules or groups of modules of the program under investigation, or smaller areas down to individual words. One extra rule places time spent in the Forth core into the bucket from where the Forth core was called.
This approach gave me the overview I was looking for. I found that ~10% compiler time was spent in one single inefficient word and another ~10% in an inefficient module interface, both of which I wouldn't have guessed to be hotspots.
The core code lives here: https://github.com/pzembrod/cc64/blob/m ... ofiler.fth
And here are the reports for profiler runs over the main e2e test suite over time, with successive optimizations applied, and over different bucket groups:
https://github.com/pzembrod/cc64/tree/m ... e-register
Would this profiler be useful or interesting for anyone else?
Cheers
/Philip
Edited 2021-05-31: Changed the v0.9-dev branch links to master branch links since branch v0.9-dev is now deleted.
A small Forth profiler
A small Forth profiler
Last edited by pzembrod on Mon May 31, 2021 8:58 pm, edited 1 time in total.
Re: A small Forth profiler
I'm interested in having a look, but your links don't work for me, I get GitHub 404.
P*h*i*l*l*i*p EEaattoon in real life
Re: A small Forth profiler
Check the main branch - looks like the specifically linked dev branch has been pruned.
https://github.com/pzembrod/cc64/blob/m ... ofiler.fth
https://github.com/pzembrod/cc64/tree/m ... e-register
https://github.com/pzembrod/cc64/blob/m ... ofiler.fth
https://github.com/pzembrod/cc64/tree/m ... e-register
Re: A small Forth profiler
BigEd wrote:
Check the main branch - looks like the specifically linked dev branch has been pruned.
I now also fixed the links in the initial post, with an "edited" note.
Re: A small Forth profiler
Great, thanks!