-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose algo
/ digest in cache_
#28
Comments
I think this is a good suggestion, there should be a more public way to do so. It is technically possible to change this already (though undocumented), the f <- function(x) x
memoise(f) -> fm
environment(fm)$`_digest` <- function(..., algo) digest::digest(algo = "xxhash64", ...)
fm(1)
#> [1] 1
fm(2)
#> [1] 2 |
25162b8 now has the cache functions specify the digest, and the algo paramter is in their constructor, so this can be easily overridden if needed. |
This was super fast, thank you! I agree with using |
I am curious about the thought process behind the choice of hash functions, both |
As stated in the body of the issue, certain Windows versions impose limitations on the total path length, i.e., |
I think these are the links regarding speed: http://create.stephan-brumme.com/xxhash/ http://cyan4973.github.io/xxHash/ |
Thank you, @MikeBadescu. Your explanation and references helped. |
Would it be possible to expose to the user the
algo
parameter for digest added in 4b3eb9f?128 characters for a file name might be a little too much for Windows when the total path length should be 260 (although this is changing). Moreover, other hash functions are faster.
Even better, would it be possible to supply the digest function from the
cache_
closure (as it is done withreset
,set
, etc.)? This would allow the user to provide their own digest function.The text was updated successfully, but these errors were encountered: