tidyverse / purrr

A functional programming toolkit for R
https://purrr.tidyverse.org/
Other
1.27k stars 271 forks source link

Performance issue: purrr::flatten #1102

Closed JLHerreraCortijo closed 10 months ago

JLHerreraCortijo commented 11 months ago

After purrr::flatten has been superseded, something is impacting its performance. When you profile this code

for(i in 1:1000){
 x <-  purrr::flatten(list(a=list(1,2,3),b=list("a","b","c")))

}

The data shows a call to utils::readCitationFile() consuming much time.

Platform: posit cloud RStudio version: RStudio Pro 2023.06.1 Build 524.pro1 R version output:

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          3.1                         
year           2023                        
month          06                          
day            16                          
svn rev        84548                       
language       R                           
version.string R version 4.3.1 (2023-06-16)
nickname       Beagle Scouts   
hadley commented 10 months ago

Duplicate of https://github.com/r-lib/lifecycle/issues/167