-
Notifications
You must be signed in to change notification settings - Fork 502
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
add demo to simulate usage in a game engine #603
Conversation
At RustConf we were discussing the general idea that we may be too aggressive about waking threads, and too slow about putting them back to sleep. I worried about this as a broad problem as core & thread counts rise, when there won't always be enough work to spread around. So, this is great to have a real demo of the issue! |
Ah, we were discussing wake-ups in the cross-linked issue #576 too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use platform specific dependencies for libc
and winapi
, with appropriate cfg
on their extern crate
declarations too.
Otherwise, looks good to me!
bors r+ |
603: add demo to simulate usage in a game engine r=cuviper a=mdonoughe It has been observed in amethyst/amethyst#780 that if you use Rayon in an environment where you are not CPU bound, you may end up using many more CPU cycles than necessary. This pull request adds an example of this problem to the demo project as a starting point towards finding a way to improve efficiency in this scenario. The life demo now has a `play` mode where the same comparison of serial and parallel occurs, but with a frame (generation) per second limit in place and comparing CPU time measurements at the end. Example output for my Ryzen 7 1800X with hyperthreading (16 logical processors) in Windows 10: $ rayon-demo life play serial: 59.93 fps cpu usage: 4.7% parallel: 59.97 fps cpu usage: 55.3% par_bridge: 59.94 fps cpu usage: 1164.1% Once there are ways to improve the overhead they should be incorporated into this demo as an example. If there are already ways to improve the demo let me know and I can try to implement them now. Co-authored-by: Matthew Donoughe <mdonoughe@gmail.com>
It has been observed in amethyst/amethyst#780 that if you use Rayon in an environment where you are not CPU bound, you may end up using many more CPU cycles than necessary. This pull request adds an example of this problem to the demo project as a starting point towards finding a way to improve efficiency in this scenario.
The life demo now has a
play
mode where the same comparison of serial and parallel occurs, but with a frame (generation) per second limit in place and comparing CPU time measurements at the end.Example output for my Ryzen 7 1800X with hyperthreading (16 logical processors) in Windows 10:
Once there are ways to improve the overhead they should be incorporated into this demo as an example. If there are already ways to improve the demo let me know and I can try to implement them now.