-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
clear() removes keys one by one, which is slower than it could be for RDS storrs.
Line 207 in 0c64f1e
| invisible(length(vlapply(self$list(namespace), self$del, namespace))) |
library(storr)
init_storr <- function() {
s <- storr_rds(tempfile())
keys <- as.character(seq_len(1e4))
values <- rep(TRUE, length(keys))
s$mset(keys, values)
s
}
s <- init_storr()
system.time(s$clear())
#> user system elapsed
#> 0.244 0.866 1.111
s <- init_storr()
system.time(unlink(file.path(s$path, "keys", s$default_namespace), recursive = TRUE))
#> user system elapsed
#> 0 0 0Created on 2020-03-11 by the reprex package (v0.3.0)
@richfitz, would you be open to driver-specific clear() methods so we can do whatever is fastest for the situation?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels