Fingerprint indices instead of entire data object #259
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 #254
This PR switches out what we use as the "fingerprint"; instead of including the entire data object (which we then serialize many times), we now hash only the indices of which observations are in/out of the resample. This will still ensure the identical fingerprint for the same data object, which I believe will work for our use cases, for example in stacks and finetune. @simonpcouch would you mind taking a look at this and seeing if you have any concerns about this change?
It does speed things up modestly for most data sets, as shown in the issue, but it especially speeds up the kind of resampling that Daniel reported in the original issue:
Created on 2021-09-23 by the reprex package (v2.0.1)
If you have bigger data, it speeds it up way more.