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

Add a mock around rayon for disabling threading #2914

Merged
merged 1 commit into from Apr 19, 2022

Conversation

shssoichiro
Copy link
Collaborator

Profiling becomes considerably more difficult to read when rayon is
involved, because rayon nests many layers of function calls which
obscure where CPU and memory usage is actually occurring. This uses the
maybe-rayon crate as a wrapper around rayon, which by default passes
through to rayon with zero overhead, but by disabling the "threading"
feature in rav1e, the maybe-rayon crate will become a mock which calls
functions serially.

Examples:

Memory flamegraph with rayon:
Screenshot_2022-03-24_10-49-12

Memory flamegraph without rayon:
Screenshot_2022-03-24_10-48-05

Copy link
Member

@tmatth tmatth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay determinism.

Profiling becomes considerably more difficult to read when rayon is
involved, because rayon nests many layers of function calls which
obscure where CPU and memory usage is actually occurring. This uses the
maybe-rayon crate as a wrapper around rayon, which by default passes
through to rayon with zero overhead, but by disabling the "threading"
feature in rav1e, the maybe-rayon crate will become a mock which calls
functions serially.
@shssoichiro shssoichiro merged commit bb1abd7 into xiph:master Apr 19, 2022
@shssoichiro shssoichiro deleted the maybe-rayon branch April 19, 2022 22:04
@barrbrain barrbrain added this to Done in Release 0.6 Sep 10, 2022
kleisauke added a commit to kleisauke/rav1e that referenced this pull request May 20, 2023
This is now part of the maybe-rayon crate introduced in PR xiph#2914.
barrbrain pushed a commit that referenced this pull request May 20, 2023
This is now part of the maybe-rayon crate introduced in PR #2914.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants