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.fthAnd 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-registerWould 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.