I wonder if it's possible to speed up Rcpp_eval(), e.g., by making use of R_ErrorHook. The current implementation seems to wrap an evalq call in a tryCatch at the R level. I understand that we can't simply use Rf_eval() because our destructors won't be called.
Motivation: Introducing Rcpp_eval() instead of Rf_eval() has made dplyr one order of magnitude slower for some operations:

Here's the offending commit: tidyverse/dplyr@7ea10. The plot shows only an excerpt of the whole history, but the weak performance is still present in dplyr's current master.
Related: tidyverse/dplyr#2220.
CC @hadley @kevinushey @romainfrancois.
I wonder if it's possible to speed up
Rcpp_eval(), e.g., by making use ofR_ErrorHook. The current implementation seems to wrap anevalqcall in atryCatchat the R level. I understand that we can't simply useRf_eval()because our destructors won't be called.Motivation: Introducing
Rcpp_eval()instead ofRf_eval()has made dplyr one order of magnitude slower for some operations:Here's the offending commit: tidyverse/dplyr@7ea10. The plot shows only an excerpt of the whole history, but the weak performance is still present in dplyr's current master.
Related: tidyverse/dplyr#2220.
CC @hadley @kevinushey @romainfrancois.