near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 618 forks source link

near-vm: Make rayon unconditional and remove `into_par_iter_if_rayon` #8948

Open nagisa opened 2 years ago

nagisa commented 2 years ago

Describe the bug

Making use of rayon optional is causing us to take suboptimal implementation decisions that hurt both rayon and non-rayon use-cases (such as collecting twice, first into a vector, then into PrimaryMap.)

If making use of rayon unconditional (if you need to limit worker threads, setup the thread pool accordingly) makes way for simplifying those areas of code, we should just go ahead with it.

matklad commented 2 years ago

My gut feeling is that we should unconditionally not use rayon perhaps? It won't help with worst-case, and, architecture-wise, it is perhaps more prudent to add || on a higher level:

nagisa commented 2 years ago

That would work too, sure.

matklad commented 2 years ago

Ok, let's just remove rayon then!

Ekleog-NEAR commented 2 years ago

Related discussion: https://github.com/near/nearcore-private-1/issues/2#issuecomment-1256030324