I'm trying to figure out how much resources (in terms of threads and space) this code below consumes. I initiated parallel tasks using par_split then another in every task. Please advice me if something bad with code, and consider when input is huge
Rayon will set up a global thread pool, a queue for tasks, and the parallel iterators will create linked lists or trees of partially completed work, which will be later appended into a vec, which may get reallocated and copied several times.
In this example rayon's bookkeeping is probably doing 100 times more work than parsing of this short list. Unless the list is megabytes long, there's probably no point trying to use threads to parse it, whether via rayon or anything else.