perf: the examples that sweep by hand solve their points side by side, through parallel::map_in_order - #151
Merged
Merged
Conversation
…, through parallel::map_in_order
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #137 (its jobs' half was #146).
What
photonoxide::parallel::map_in_order(items, f):fon each item side by side on rayon's threads, the results in the items' order, so a caller that prints or records them afterwards writes what a loop over them writes. A library helper, as the issue asked, rather than threading in each example: the studio builds the examples in and doesn't depend on rayon.strip_waveguide(three grids),hadley_corners(four figures × five grids, both schemes) andgroup_index(five widths, each tracked over the wavelengths) solve their problems with it and then print in order. Their output is byte for byte examples/output/'s (checked for all three).Measured
photonoxide bench example/... --threads 1,20, Core Ultra 7 265K, same session:hadley_cornersgroup_indexstrip_waveguideEach used to be slower on 20 threads than on one. docs/benchmarks.md regenerated; ROADMAP ticks "Sweeps side by side".
Checked
parallel's test: results in order on 1, 3 and 8 threads; its doctest.cargo test --release(361 passed), the studio's tests (35), clippy on both crates, rustdoc with-D warnings.