Closed Veedrac closed 9 years ago
The idea here is, if possible, first commit your version in the official rust repo. You can open a pull request here, and we (well, at least me) will comment on it, but it will be merged after being merged to the rust repo. Then, it may be easier to first be reviewed here before on the rust repo.
I propose you open a PR, or you open a PR on rust repo and link to here, as you wish.
Thanks for contributing :)
I think the same technique should also be applicable to fasta-redux.
Upstream PR seems to be https://github.com/rust-lang/rust/pull/28623
Exactly. Veedrac asked me to submit it for him, because I have a faster machine and could build it in less time.
I've seen the PR in the fasta-redux issue and just wanted to connect the PR to this issue, too.
Yeah, once upstream merges my PR, I'll ask teXitoi to merge #20 and submit the fasta_redux
to the benchmarksgame tracker, too.
I gave my variant of fasta on the Benchmarks Game tracker and got directed here for comments.
The basic idea was that the x86 one core benchmarks put Haskell well in the lead. I just took the multithreaded Rust program and copied Haskell's implementation.
This has two main techniques:
B.putStrLn ""
by temporarily mutating the buffer to have an appropriately placed newline.Then I parallelized the RNG by implementing a somewhat trivial
future
method that allows getting parallel streams of the same RNG. This makes parallelism on my two cores almost 100% efficient, although I've no idea what'll happen with more than two.I also stole the
while let Err(_) = wr.lock().unwrap().write(...)
idea, but I added astd::thread::yield_now()
. IIRC, it seems to help, although I can't remember by how much.I can make a pull request if wanted.