If you have worked with procedures in the past, especially ones with lots of potentially expensive operations, you’re familiar with the need to optimize your code. However, once you have implemented a new approach to your problem it’s easy to be biased towards your new code even if it isn’t better. (I plead guilty!)
I hereby present milliBench, a meta-project / template designed to only be used in the Companion. It can measure evaluation times of your procedures (both return types and do types) in milliseconds for objectively comparing the speed of different procedures. It was originally built for use in the KodeJam, as a tool for the daily challenges. Maybe the Community-run DCs can use it too?
Just throw your procedure definition into the project, along with any required global variables (make sure to look out for name conflicts) and other components. Then, head over to this block:
The comments should be clear. However I’ll reiterate that the do section should be left empty for return type procedures.
milliBench does not support multi-part procedures (chaining do’s and events). However if enough* people request it, I’ll make a version to support that.
That’s all for now. Hope everyone is safe and doing well. Cheers, and happy koding!