Just in case, you hadn't noticed:
Since Sep.17, we have had the faster try() now in both R-devel
and "R 4.1.1 patched" which will be released as R 4.1.2 by the
end of this month, with NEWS entry
• try() is considerably faster in case of an error and long call,
as e.g., from some do.c
In fact an attentive user reported the same type of (slow due to deparse)
problem in may tryCatchLog package recently when using a large sparse matrix
https://github.com/aryoda/tryCatchLog/issues/68
and I have fixed it by explicitly using the nlines arg of deparse() instead of
using as.char
> Martin Maechler
> on Thu, 16 Sep 2021 17:48:41 +0200 writes:
> Alexander Kaever
> on Thu, 16 Sep 2021 14:00:03 + writes:
>> Hi,
>> It seems like a try(do.call(f, args)) can be very slow on error
depending on the args size. This is related to a complete dep
> Alexander Kaever
> on Thu, 16 Sep 2021 14:00:03 + writes:
> Hi,
> It seems like a try(do.call(f, args)) can be very slow on error depending
on the args size. This is related to a complete deparse of the call using
deparse(call)[1L] within the try function. How about re
Hi,
It seems like a try(do.call(f, args)) can be very slow on error depending on
the args size. This is related to a complete deparse of the call using
deparse(call)[1L] within the try function. How about replacing
deparse(call)[1L] by deparse(call, nlines = 1)?
Best,
Alex
Example:
fun <- f