Closed yaccos closed 2 years ago
Thank you so much. I'll try to get to this as soon as possible.
UPDATE: I've started revdep checks for 392 packages toward this PR. Hopefully, it goes well.
UPDATE: I've started revdep checks for 392 packages toward this PR. Hopefully, it goes well.
It should do because the change will not provide any user-visible differences, it doesn't even touch any R code. Better safe than sorry though.
UPDATE: I've started revdep checks for 392 packages toward this PR. Hopefully, it goes well.
It should do because the change will not provide any user-visible differences, it doesn't even touch any R code. Better safe than sorry though.
Yup. Submitting such a big package to CRAN relying only on "should" is a big risk. Even the smallest change can break something somewhere, which can stir up a bit of chaos on CRAN. And there's also the possibility for our own mistakes. Also, if there's something showing up in the future, it's nice to have a recent revdepcheck baseline to compare to.
... which leads to: revdep checks spotted the following regressions:
Running those tests manually revealed the following:
and
I'll fix.
Thank you. I always find it embarassing to forget debugging print statements left in the code. By the way, did you actually benchmark the fix?
No worries. No I didn't benchmark. Do you think you can benchmark some of them?
In this pull request, I have generalized Pull Request #216 and made the optimization for the remaining functions in the package. Instead of adding
if
-statements throughout the package, I have modified the macrosR_INDEX_OP
andR_INDEX_GET
by adding flags which tell whether checking forNA
indicies should be conducted. These flags are added in the lowlevel functions asrowsHasNA
andcolsHasNA
and are constant throughout the execution of the function. Hence, the compiler will (hopefully) optimize out checking forNA
indices before iterating, if possible. These flags are set byvalidateIndiciesCheckNA()
at the time of index validation. In the earlier versions of the package, the index validation framework did check if any indices wereNA
, but the result was thrown away.This approch eliminates checking for
NA
indicies both when no indicies are supplied (as the situation was inmatrixStats
0.60.0 and earlier) and also when the user-specified indicies do not have anyNA
values (which is a new feature). Still, there is someNA
checking for indices which does not useR_INDEX_OP
norR_INDEX_GET
(for instance in the naming framework), but I do not consider it critical for real-world performance.