Closed shikokuchuo closed 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.
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.
Thanks!
As per the suggestion by Winston Chang.
rlang::as_function()
usage only where!is.function()
In addition:
Closes #186.