[R-pkg-devel] Examples taking too long depend on object that takes a while to generate

John Harrold john@m@h@rro|d @end|ng |rom gm@||@com
Wed Sep 14 06:10:36 CEST 2022


Hello Greg,

The fetch_fit_example is the function that creates the object. It takes the
bulk of the time.

The problem is I cannot distribute the sample object under inst because it
needs to be compiled under the specific architecture. It also needs to be
compiled using the version of nlmixr2 the user has installed.

I'm looking into a less complicated example right now, but I think I may
not be able to get it under 5 seconds.

Thanks
John





On Tue, Sep 13, 2022 at 9:06 PM Greg Hunt <greg using firmansyah.com> wrote:

> John,
> You have read_template, fetch_fit_example, yaml_read_fit and
> build_figures taking up that time. Have you checked the individual timings?
> If you are spending 27 seconds of user time on a small data set I'd wonder
> what the full-scale times look like. I'd still be wondering whether you
> have a non-linear ratio of processing cost to data size.
>
> The examples don't need to process meaningful data, they are just examples
> of what the code should look like.
>
> if your absolute minimum time is still above 10 seconds you could
> distribute a sample object under inst I suppose.
>
> Greg
>
>
>
>
> On Wed, 14 Sept 2022 at 13:51, John Harrold <john.m.harrold using gmail.com>
> wrote:
>
>> Hello Greg,
>>
>> I'm already using a reduced dataset. I can reduce it a little bit further
>> but it doesn't really change things much.
>>
>> John
>>
>> On Tue, Sep 13, 2022 at 8:35 PM Greg Hunt <greg using firmansyah.com> wrote:
>>
>>> John,
>>> Can you cut the test data size back?  Do you have some processing costs
>>> that are non-linear with data size?  27 seconds of user CPU is an awful lot
>>> of processing these days.
>>>
>>> Greg
>>>
>>> On Wed, 14 Sept 2022 at 13:21, John Harrold <john.m.harrold using gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm working on submitting a new package. I've created examples for each
>>>> of
>>>> the functions. Most of these functions depend on an R object that uses
>>>> architecture-specific compiled code. To create that object can take
>>>> between
>>>> 10-20 seconds. The function that creates it will cache it in the
>>>> tempdir().
>>>> So the first example that uses that object will take more than the 5
>>>> seconds allowed by CRAN. If I wrap that example in donttest, then the
>>>> next
>>>> function that uses it will exceed the 5 second limit, and on. I
>>>> submitted
>>>> the package with all of these examples wrapped in donttest, but that
>>>> got me
>>>> dinged :). So I'm trying to come up with a solution and I'd appreciate
>>>> any
>>>> help here.
>>>>
>>>> Is there some way to build an object before tests are run?
>>>>
>>>> Thank you,
>>>> John
>>>>
>>>> If it would help this is an example where I'm testing it in win-builder:
>>>>
>>>> https://win-builder.r-project.org/6641irOr4mI6/
>>>>
>>>>         [[alternative HTML version deleted]]
>>>>
>>>> ______________________________________________
>>>> R-package-devel using r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>>>
>>>
>>
>> --
>> John
>> :wq
>>
>

-- 
John
:wq

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list