Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix high cpu usage #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FranciscoCaetano88
Copy link

@FranciscoCaetano88 FranciscoCaetano88 commented Nov 23, 2020

Due to the high CPU demand of executing a step function per code expression with a given timeout, we decided to only use the timeout in certain cases. We need to keep the steps per code expression so we can pause/resume/stop the interpreter.

We now have 4 step cases:

  • step() => resolve immediately
  • step(0) => resolve immediately
  • step(100) => resolves in 100ms
  • step(Infinity) => doesn't resolve (used when the stepper is paused, it'll resolve when the stepper is resumed)

Steps should resolve as fast as possible so we removed the step time option from the project.
Some tests required some changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant