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

Single timer #61

Open
fengb opened this issue Jan 4, 2021 · 1 comment
Open

Single timer #61

fengb opened this issue Jan 4, 2021 · 1 comment

Comments

@fengb
Copy link
Owner

fengb commented Jan 4, 2021

Benchmarking shows all the subcomponents taking up non-trivial computation time. This includes Temportal, which 99% of the time is doing an increment followed by a compare. My hypothesis is that because each subcomponent has its own timer, it's creating unnecessarily duplicated work. This probably isn't much, but maybe we can eek 5-10% out.

Current architecture:

  • CPU: tick -> cmp_int -> [maybe fire]
  • Video: tick -> cmp -> dispatch work
  • Timer: tick -> cmp -> [slow tick]
  • Temportal: tick -> cmp -> [save state]

Proposed architecture:

  • Timer: tick -> cmp -> [slow tick]
  • CPU: tick -> cmp -> dispatch work (cpu inst duration varies so it needs a separate timer)
  • Video: offset_cmp -> dispatch work (not sure if applying an offset to the video is better than a separate timer)
  • Temportal: cmp -> [save state]
@fengb
Copy link
Owner Author

fengb commented Apr 22, 2021

The ticks show up when profiling individual pieces, but it seems like outside of profiling, the compiler somehow optimizes this away. Even after manually unrolling loops, I did not get any performance gains.

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

No branches or pull requests

1 participant