You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would calling rlang::global_entrace() in production code / scripts incur a noticeable performance reduction?
Or, to put it otherwise:
Would you recommend putting this in all of our scripts, for immediate debugging output once problems occur? Or would you instead recommend to only add this while debugging, so after finding an error and only while digging into it?
The text was updated successfully, but these errors were encountered:
It only incurs a small performance cost on unhandled errors, so it should be fine to use in your scripts. But please let us know if you find that this is not the case.
It's mostly meant to be used in personal Rprofiles rather than scripts though.
Many thanks for this useful (and quick) assessment, that's very much appreciated.
And maybe some more context from my side, in case your curious why I'm asking: I'm working in bioinformatics, where lots of the packages come with very mixed error handling and we use lots of different packages all the time. There, with package version changes, complicated dependencies and changing reference datasets, you have quite a lot of opportunities for stuff to throw unhandled errors unexpectedly.
So for now, I think I'll probably opt for using rlang::global_entrace() in any scripts that go beyond just loading the library("tidyverse") and doing some simple data cleaning or plotting... When things go wrong unexpectedly, I should at least get a useful backtrace. Many thanks for providing this!
I have searched the
rlang
docs forrlang::global_entrace
and had a look at the actualrlang::global_entrace()
function code, but don't understand the code enough to arrive at an answer to this question by myself:Would calling
rlang::global_entrace()
in production code / scripts incur a noticeable performance reduction?Or, to put it otherwise:
Would you recommend putting this in all of our scripts, for immediate debugging output once problems occur? Or would you instead recommend to only add this while debugging, so after finding an error and only while digging into it?
The text was updated successfully, but these errors were encountered: