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.


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.

Assigned to
1 year, 6 months ago
1 year, 2 months ago
2021.7 RFC performance vm

~crc_ 1 year, 6 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.


#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 1 year, 5 months ago

~crc_ referenced this from #56 1 year, 2 months ago

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