6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 5:40 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: A small Forth profiler
PostPosted: Fri Apr 16, 2021 7:24 pm 
Offline

Joined: Sat Sep 05, 2020 3:12 pm
Posts: 22
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.


Last edited by pzembrod on Mon May 31, 2021 8:58 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri May 21, 2021 11:27 am 
Offline
User avatar

Joined: Wed Feb 23, 2005 9:20 am
Posts: 23
Location: Zurich, Switzerland
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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 21, 2021 11:46 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 21, 2021 11:56 am 
Offline
User avatar

Joined: Wed Feb 23, 2005 9:20 am
Posts: 23
Location: Zurich, Switzerland
Works now, thanks!

_________________
P*h*i*l*l*i*p EEaattoon in real life


Top
 Profile  
Reply with quote  
PostPosted: Mon May 31, 2021 9:00 pm 
Offline

Joined: Sat Sep 05, 2020 3:12 pm
Posts: 22
BigEd wrote:
Check the main branch - looks like the specifically linked dev branch has been pruned.


Thanks, BigEd, correct, I had since merged the dev branch into master and deleted it.
I now also fixed the links in the initial post, with an "edited" note.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 31, 2021 9:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Great, thanks!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: