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

Analyse UI performance, fix low-hanging-fruit items #90

Open
jamesyoungman opened this issue Jun 12, 2022 · 1 comment
Open

Analyse UI performance, fix low-hanging-fruit items #90

jamesyoungman opened this issue Jun 12, 2022 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Web Web UI issues

Comments

@jamesyoungman
Copy link
Contributor

I think some of the design choices in the UI implementation have bad performance characteristics. For example, we update the I/O and Alarm status panels after every instruction. This could be the reason why it takes the simulator several seconds to read the 360 lines of the "hello.tape" example program even though (1) the data is in memory, and (2) the simulated tape reader should be able to do this in under a second.

I'd like this code to be usable on portable devices (e.g. tablets) and it needs to not eat battery.

@jamesyoungman jamesyoungman added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Web Web UI issues labels Jun 12, 2022
@jamesyoungman
Copy link
Contributor Author

The obvious performance bottlenecks are

  1. I/O status updates (~2ms per tick)
  2. Rust tracing code (~0.2ms per tick)
  3. JavaScript marshalling (for values returned from WASM to JS) (also ~0.2ms per tick).

The UI update performance issue can be mitigated by reducing UI update frequency to, say, once every 100ms. The overhead of the tracing and WASM/JS marshaling infrastructure is much less tractable. But it is important, as we would want the time taken for the simulator to emulate an instruction to be comfortably less than the time taken by the original machine, so that we can reliably run at the same speed as the original machine.

@jamesyoungman jamesyoungman self-assigned this Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Web Web UI issues
Projects
None yet
Development

No branches or pull requests

1 participant