~crc_/retroforth#28: 
i/o device: benchmarking

In #26, Scott raised the possibility of adding some query slots to the VM for benchmarking purposes.

I'd prefer to have a separate benchmarking device for VM's that support this.

Proposal:

Add an optional I/O device that provides for additional introspection and timing as an aid to benchmarking and statistics gathering.

Based on Scott's suggestions, this should provide:

  • Query opcode counts
  • Call a function (tracking start/end times), returning the total time taken
  • Current timestamp
  • Timestamp to UTC/ISO string

There should probably also be some functionality to reset the instruction counts and enable/disable tracking of instruction usage to reduce overhead when not benchmarking.

Status
REPORTED
Submitter
~crc_
Assigned to
No-one
Submitted
5 months ago
Updated
2 months ago
Labels
2021.7 RFC performance vm

~crc_ 5 months ago

#Basic Information

An initial outline for the I/O device for benchmarking/profiling

Device ID: TBD

Device #: TBD

This device provides additional introspection and functionality for those who need to profile and benchmark code.

#Operations

#Level 0

This reflects the minimal level of functionality to be considered useful.

0: Execute Function

Stack:  count-address function-address -- time-delta

Runs the code at the specified address. When done, store the instruction usage counts in memory, starting at the specified address. This will need 30 cells of memory for the returned values.

This will return a value on the stack indicating the amount of time taken to run the function.

1: Timer Resolution

Stack:  -- value

Return a number representing the resolution of the system timer


I'm tentatively planning to implement level 0 as an option for the C and Python VM implementations after 2021.1; and will work on additional functionality after this is done.

~crc_ referenced this from #36 5 months ago

~crc_ referenced this from #56 2 months ago

Register here or Log in to comment, or comment via email.