Closed koheiw closed 4 months ago
> require(Matrix)
> mat <- rsparsematrix(1000, 10, 0.5)
>
> print(object.size(dist(mat, sparse = TRUE)), unit = "Mb")
7.6 Mb
> print(object.size(dist(mat, sparse = FALSE)), unit = "Mb")
3.8 Mb
>
> microbenchmark::microbenchmark(
+ dist(mat, sparse = TRUE),
+ dist(mat, sparse = FALSE),
+ times = 10)
Unit: milliseconds
expr min lq mean median uq max neval
dist(mat, sparse = TRUE) 26.4083 26.6380 26.89330 26.8313 27.1955 27.6437 10
dist(mat, sparse = FALSE) 25.3591 25.8587 27.59053 26.1021 26.3652 41.3386 10
@rcannood can you review?
@rcannood thank you!
Add
sparse = TRUE
. This is a new branch for #38.