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

Should we limit the FPS? #59

Closed
lunacookies opened this issue Mar 22, 2021 · 1 comment
Closed

Should we limit the FPS? #59

lunacookies opened this issue Mar 22, 2021 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@lunacookies
Copy link
Collaborator

Terminal emulators such as Alacritty take as much data as possible from the program and only update the window at a certain refresh rate. If we limit pipes-rs to output at the same rate as the window, then we’ll save a lot of unnecessary stepping of the world when the window isn’t even updating. I guess the pipes are still moving during this time between window updates, which means this change would slow down pipe movement, but thereby make pipe movement speed consistent regardless of the terminal’s speed.

spin_sleep is perfect for both implementing this and an FPS meter.

@lunacookies lunacookies added enhancement New feature or request question Further information is requested labels Mar 22, 2021
@lunacookies
Copy link
Collaborator Author

I tried implementing this, but it doesn’t work because the terminal doesn’t display things instantly after flushing STDOUT, so the reported FPS is misleading and only accounts for pipes-rs’s processing and sending the data to be printed to the terminal. As far as I know, there isn’t a way to ensure that data has reached the terminal and has been displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant