futureverse / futureverse/listenv
naive performance benchmarks
- Dominant language
- R
- Stars
- 31
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Thanks so much for `listenv`. It is a great idea, and I have enjoyed using already. I am in over my head, but I thought some naive performance benchmarks would be interesting, since `environment` usually offers a big performance boost (see http://jeffreyhorner.tumblr.com/post/117059271933/hash-table-performance-in-r-part-iv)
``` r
library(microbenchmark)
library(listenv)
n <- 2e4
env_env <- function(){
env_env <- new.env()
for(x in seq.int(1,n)){
env_env[[as.character(x)]] <- runif(1)
}
env_env
}
list_env <- function(){
list_env <- listenv()
for(x in seq.int(1,n)){
list_env[[x]] <- runif(1)
}
list_env
}
list_list <- function(){
list_list <- list()
for(x in seq.int(1,n)){
list_list[[x]] <- runif(1)
}
list_list
}
mb <- microbenchmark(
env_env()
,list_env()
,list_list()
,times=10
)
autoplot(mb)
```

Contributor guide
Research direction
Start with the supplied R example and compare the `environment`, `listenv`, and regular-list cases using `microbenchmark`. Clarify where reproducible benchmarks should live and which results are expected; done means the agreed benchmark output is recorded for these comparisons.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100