r-lib / later

Schedule an R function or formula to run after a specified period of time.
https://r-lib.github.io/later
Other
137 stars 27 forks source link

Implements avoid loading `rlang` where not required #187

Closed shikokuchuo closed 4 months ago

shikokuchuo commented 4 months ago

As per the suggestion by Winston Chang.

In addition:

Closes #186.

wch commented 4 months ago

This is great. Can you also add an entry to the NEWS.md file?

I'm curious: how much of a speed improvement does the symbol registration provide?

There could be another boost from removing the Rcpp dependency and replace it with cpp11, but that would be a more difficult project.

shikokuchuo commented 4 months ago

Have added the comments and a NEWS item.

The saving from native symbol registration is every time there is a .Call(). As dynamic lookup involved a string search... I haven't benchmarked but remember it being slow. I contributed this change to the torch mlverse package some time ago, and as it is so atomic there (nearly every operation is an underlying tensor operation hence a .Call), the impact was not negligible.

wch commented 4 months ago

Thanks!