Last active
August 11, 2017 14:28
-
-
Save PeteHaitch/e6364c14d0c04d66a1b1db88fbcc7016 to your computer and use it in GitHub Desktop.
Reproducible example from https://twitter.com/RoryKirchner/status/895731797576822784
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(profmem) | |
library(Matrix) | |
dgt <- readMM("~/sparse.mtx.gz") | |
dgc <- as(dgt, "dgCMatrix") | |
threshold <- 5 | |
# Total memory allocation (bytes) | |
total(profmem(Matrix::colSums(dgt > threshold))) | |
#> [1] 935422632 | |
total(profmem(Matrix::colSums(dgc > threshold))) | |
#> [1] 787165392 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment