New addon: Timing and RTC profiler #7418
Labels
new addon
Related to new addons to this extension. `scope: addons` should still be added.
scope: addon
Related to one or multiple addons
type: enhancement
New feature for the project
Why this would be helpful
I would like a way for people to time their projects more easily. When optimizing a project timing is neccessary for implementation comparisons. I envision this timing method to allow for timing within absolute and relative terms.
Here's what I mean by relative timing:
The time for each block to run may be different per computer but it's time relative to any other block remains constant. As using the subtraction operator as an atomic unit (a logical choice due to it's prevelance in most projects), we can determine the cost of any block relative to the subtraction operator which we call the Relative Time Cost (RTC). The table that lists this RTC is given here: https://scratch.mit.edu/projects/725580642/
How this addon works
I envision this working in one of two ways:
Option 1: A START TIMING and END TIMING timing block. would be part of the debugger blocks category. The block starts and ends timing a particular section of the code, and has an input for a label. This is the most flexible option, but the blocks themselves might cause some overhead and it requires two new blocks to be added. The list of labelled timing sections is visually displayed.
Might look something like this:
Option 2: You can right click on a hat block (block stack) and hook a timer to it. This list of hooks is visually displayed. Once hooked, right click lets you unhook. A hat block displays that it is hooked with an icon in the top left. This times the time it takes to go from the hat block to exiting the thread attached to the hat block.
Then the debugger tab would have a new section called TIMING.
This would display for each of the labelled timing blocks / timed custom blocks:
Advantages of option 1:
Advantages of option 2:
Possible alternatives
No response
Additional context
I discussed this 4 years ago: #117
Since then the addon has grown, and the Debugger tools were added. I am confident this can be made without too much trouble now.
The text was updated successfully, but these errors were encountered: