Closed philipp-baumann closed 1 year ago
My conclusion is that at least in Reduce
context, append()
instead of c()
is neither faster nor better in terms of memory (needs also more frequent calls to Garbage Collector.
before (current master) : c3e4c2d38594574f38de48283e6e181ddfda8dfb
r$> library("opusreader2")
file <- opus_file()
r$> bnch <- bench::mark(
data <- read_opus(dsn = file)
)
r$> bnch
# A tibble: 1 × 13
expression min median `itr/sec` mem_alloc `gc/sec` n_itr n_gc total_time result memory time gc
<bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> <int> <dbl> <bch:tm> <list> <list> <list> <list>
1 data <- read_opus(dsn = file) 17.5ms 17.9ms 54.4 1.73MB 172. 6 19 110ms <named list [20]> <Rprofmem [504 × 3]> <bench_tm [25]> <tibble [25 × 3]>
after (this PR)
r$> library("opusreader2")
file <- opus_file()
r$> bnch <- bench::mark(
data <- read_opus(dsn = file)
)
Warning message:
Some expressions had a GC in every iteration; so filtering is disabled.
r$> bnch
# A tibble: 1 × 13
expression min median `itr/sec` mem_alloc `gc/sec` n_itr n_gc total_time result memory time gc
<bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> <int> <dbl> <bch:tm> <list> <list> <list> <list>
1 data <- read_opus(dsn = file) 19.4ms 20ms 46.7 2.07MB 52.6 24 27 514ms <named list [20]> <Rprofmem [577 × 3]> <bench_tm [24]> <tibble [24 × 3]>
closing because this PR with append has no advantages.
addresses part of #52