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

Rayon does not work well with the optick profiling and performance logging library #1221

Open
vladkvit opened this issue Dec 23, 2024 · 1 comment

Comments

@vladkvit
Copy link

I made a sample repo (that contains a sample capture) to demonstrate the issue - https://github.com/vladkvit/test_rayon_optick

When rayon's par_iter() is used, none of the optick::event!() calls are logged from the spawned threads. I'm curious if this is an issue on the optick side or the rayon side, would love someone more knowledgeable to take a look.

FWIW, I also cross-posted the issue here - bombomby/optick-rs#9

@cuviper
Copy link
Member

cuviper commented Dec 23, 2024

If optick is using thread-specific state, then it wouldn't surprise me at all that it fails to see inside the rayon thread-pool. I've never used it, but at a glance optick::start_capture() does look like it's only for the current thread.

You might be able to use a ThreadPoolBuilder::start_handler to turn it on, but it will probably still get confused about the hierarchy of events due to rayon's work-stealing. See also #915.

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

No branches or pull requests

2 participants