-
Notifications
You must be signed in to change notification settings - Fork 48
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
Initial rayon
support: ParallelExtend + FromParallelIterator
#89
Conversation
This was a straightforward step towards jonhoo#14
Codecov Report
|
Thank you! @cuviper Since you have the most rayon experience (I believe), would you mind taking a look at this? |
@jonhoo No problem. Do you have any suggestions for getting my tests running on CI? They’re behind a feature flag so I don’t think they’re being picked up. |
By default the normal test suite should be run with Line 60 in 448d9f6
Line 76 in 448d9f6
Line 94 in 448d9f6
To also include your feature (or just make them --all-features — that seems reasonable too).
|
Ah, I guess they're running but not picked up by I've been thinking a bit about having to create a guard for every element we want to add. Creating a guard is a bit expensive (it definitely has a performance impact on my project using |
Ahhh, yeah, that's awkward. Looks like the template we're using doesn't pass So, the guard stuff is actually pretty thorny 😅 We've discussed it a lot over in jonhoo/bustle#2 (comment) (and the following comments) which you may want to take a look at. I think we should probably not make a change to how guards work in this PR. Definitely agree that we should be able to do better than creating a guard for every access in rayon though. @cuviper does |
Yeah my initial idea to use a thread local on the stack doesn't work, as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me.
I'll let @jonhoo decide if CI/coverage is good enough...
Just pinging that this is still on my radar, will hopefully get to this in the later half of the week :) |
Okay I think this hits a decent subset of the impls we want, plus mostly okay tests. Might be suffering a bit of PR creep, so I'd rather not make it any bigger. |
This looks good to me — thanks! |
One of Rust's features is the naming convention, it seems clumsy and random(like a blaster). That has both pro(s) and con(s), like not knowing what something is. I think the OP(@Others @jonhoo) here should be extended with a short description of what is the goal this PR is trying to accomplish... With an intention on explaining it to someone who will then follow newly added links to rayon site(s) for deeper explanation and further reading I.E. someone who thinks rayon has more todo with light than as a Rust crate.
|
I'm not exactly sure what you're asking for here? If you'd like to see documentation on a particular method be improved, then I'd be happy to take a PR with that improvement! |
The goal was unclear without prior knowledge of rayon or whatever. Without links to rayon that leads to googling or looking to see if there is a docs page. |
The goal of what exactly? Of the PR? Of the commit? Or of the interface in the code? I don't generally expect contributors to document their PRs/commits directly, since it's assumed that those will be seen by developers of the library, not of its users. |
This was a straightforward step towards #14.
I'm interested in trying to get some parallel iterator work going, but I thought I'd start with some small stuff :)
Points that need addressing:
par_extend_sync
is a crap name, so we likely need to think of something better!guard
for every insert operation which sucks, and I wonder if we can do better(this is especially relevant since I believe there's going to be a similar problem with parallel iterator support)
This change is