Closed jimouris closed 11 months ago
indicatif has native support for rayon iterators, maybe check that out?
Of course I tried it before asking. I saw 100% utilization from all the cores but my question was mostly focusing on whether this is efficient. What does it mean to have built in support for rayon? Doesn't it still need to be locked and unlocked all the time in order to be updated? In my understanding this would result in a lot of overhead. I'm asking to try to understand how it works.
It means you can call progress_with()
on a ParallelIterator
:
https://github.com/console-rs/indicatif/blob/main/src/rayon.rs
Of course I tried it before asking. I saw 100% utilization from all the cores but my question was mostly focusing on whether this is efficient. What does it mean to have built in support for rayon? Doesn't it still need to be locked and unlocked all the time in order to be updated? In my understanding this would result in a lot of overhead. I'm asking to try to understand how it works.
I think the 100% utilization is to be expected and is not necessarily an issue. There are no delays in the code.
Thank you, that makes sense.
Will something like the following cause
pb
to lock and eventually run sequentially?