Closed mooreryan closed 3 years ago
Oh, and the test suite still passes after the patch (on my local machine at least).
Ahhhh brilliant!! Yes, this makes sense to me. The reason behind storing the index in the @permutes slot is so you only have to call the random seed once & still get the same result from updateCutoffs() thereafter. I cannot think of any reason why you would need to fill the @permutes slot from within updateCutoffs(). Great stuff! I will accept the pull request if you can submit. Also please add yourself as a package contributor in the DESCRIPTION so you list it on your CV :)
Hey Thom...I've got another nice speedup of
updateCutoffs.propr
. It's simple...in fact, I probably should've seen it years ago.You just need to set
p = 0
in the calls topropr
that get called for each permutation inside theupdateCutoffs.propr
function.I did some profiling, saw that the resampling that happens inside propr was taking the most time during the updateCutoffs function, then doubled checked the code to ensure that the propr permutations are not necessary in this context, and then switched it to generate no permutations from within updateCutoffs.
Here's the patch
If you want, I could open a pull request, or, if it is more convenient for you, here it is as a patch file: 2-proprCall.R.patch.txt
Timing
The data is 25 samples and varying number of taxa, ran with 1, 2, and 4 cores.
A simple change, but with nice results...
Here's the benchmark code to generate the figures if you'd like to reproduce. (txt extension is so it can upload to GitHub)
bench.R.txt