OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Fixes yield proc scheduling. Turns sleeps into an opcode

Open Cyberboss opened this issue 1 year ago • 5 comments

The behavior is now the same for either spawn or sleep:

  • delay < 0: Proc will continue immediately if nothing is scheduled in the same tick. Otherwise, same as delay == 0.
  • delay == 0: Proc scheduled on end of same tick.
  • delay > 0: Proc scheduled after n ticks.

This also fixes the ProcScheduler being able to still have queued procs when running multiple tests in serial.

Then, to fix perf issues I had to redo sleeping into an opcode:

  • Remove sleep from DMStandard.
  • Two new opcodes Sleep and BackgroundSleep (which is just sleep -1, much faster than popping a float off for background sleeps).
  • Create new lightweight async proc state for sleeping.
  • Compiler/runtime adjustments to handle new opcodes.
  • Added IOpenDreamGameTiming as a wrapper around IGameTiming that we can control in unit tests.

Closes #1262

Cyberboss avatar Nov 26 '23 23:11 Cyberboss

Apparently this is still unperformant for the issue in question

Cyberboss avatar Nov 29 '23 20:11 Cyberboss

Somethings still fucky, which is why the TGS tests are failing

Cyberboss avatar Jan 01 '24 19:01 Cyberboss

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 10 '24 20:01 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Feb 12 '24 22:02 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Apr 09 '24 21:04 github-actions[bot]