[R-pkg-devel] Searching examples in source code

Ben Engbers ben@engber@ @end|ng |rom gm@||@com
Sun May 8 23:27:38 CEST 2022



Op 08-05-2022 om 22:29 schreef Duncan Murdoch:
> On 08/05/2022 3:52 p.m., Ben Engbers wrote:
>>
>>
>> Op 08-05-2022 om 21:15 schreef Joshua Ulrich:
>>> Hi Ben,
>>>
>>> On Sat, May 7, 2022 at 4:24 PM Ben Engbers 
>>> <Ben.Engbers using be-logical.nl> wrote:
>>>>
>>>> Hi,
>>>>

>> I don't remember if it was because the package is based on R6 object
>> orientation or if it was because the client is based on a client-server
>> architecture. I do know that profiling did not add much information.
>>
>> And a quick search for "R R6 profiling" shows that R6 applications
>> cannot yet be examined using a profiler ;-(.
> 
> I think that isn't completely true.  One link I read said that by 
> default the profiler code doesn't know function names, but it should 
> still know line numbers if you kept them in your source and set 
> `line.profiling` to TRUE when you run Rprof().  Setting that to TRUE 
> makes the profiling output contain much more information.
> 
> I don't have a good example to demonstrate this, and I don't know if 
> RStudio's post-processing of profiler output knows how to interpret this 
> extra information, but the base summaryRprof() will show it if you ask 
> for it, and a bad example I ran that isn't easily sharable shows that it 
> does display line numbers in R6 source.

It will take a few days but I'll check in how far this is usefull.

Ben


More information about the R-package-devel mailing list