Conversation

So, given the following program: : nop ; : test 1000000 0 do nop loop ; test it takes 10.8 seconds (on a 64MHz nRF52) to run, which means my forth runtime averages 10.8uS/nop, or 690 cycles/nop. Not great, not bad. Oh also my forth is running on an embedded target.
3
11
Hmmm... Without the call to `nop`, it takes 7.34 seconds. Which means the cost of a single empty function call is... 220 cycles? I'm upset because this doesn't matter (all the perf-sensitive stuff is going to be in Rust anyway), BUT I KNOW IT SHOULDN'T TAKE 220 CYCLES!
4
6
Replying to
This is already AOC, so I'm not sure how I would JIT it too :D Honestly, I know (roughly) why this is slow, because everything needs to pass through a large match statement to determine the next step. Perf is "good enough for now" though, so I'll leave it for a later win :)
2
1
Show replies