I have written this R package that takes ages (> 10s, sometimes up to 20-30s!) to load.
Every time the package loads, such as when building the package at the step "** testing if installed package can be loaded"
, or directly calling library("my.package")
, nothing happens for 20s.
This makes everything painfully slow during development: building documentation, building the package, running R check...
Of course I have my suspicions (looking at you, dodgy dependency), but I need to gather evidence before axing it.
Is there a way to profile the loading of the package, in order to identify the cause? Or more generally, how can I figure out what is happening under the hood?