Re: [Rd] Model object, when generated in a function, saves entire environment when saved

2020-01-30 Thread Harvey Smith
Depending on if you need the data in the referenced environments later, you could fit the model normally and use the refhook argument in saveRDS/readRDS to replace references to environments in the model with a dummy value. normal_lm <- function(){ junk <- runif(1e+08) lm(Sepal.Length ~ Sepa

Re: [Rd] anyNA() performance on vectors of POSIXct

2019-05-21 Thread Harvey Smith
at wasn't correct for the *character vector *the ALTREP ultimately represented. http://r.789695.n4.nabble.com/unsorted-suggestion-for-performance-improvement-and-ALTREP-support-for-POSIXct-td4754634.html On Tue, May 21, 2019 at 12:04 PM Martin Maechler wrote: > >>>>> Harvey Smi

[Rd] anyNA() performance on vectors of POSIXct

2019-05-01 Thread Harvey Smith
Inside of the anyNA() function, it will use the legacy any(is.na()) code if x is an OBJECT(). If x is a vector of POSIXct, it will be an OBJECT(), but it is also TYPEOF(x) == REALSXP. Therefore, it will skip the faster ITERATE_BY_REGION, which is typically 5x faster in my testing. Is the OBJECT(

[Rd] unsorted - suggestion for performance improvement and ALTREP support for POSIXct

2019-01-07 Thread Harvey Smith
I believe the performance of isUnsorted() in sort.c could be improved by calling REAL() once (outside of the for loop), rather than calling it twice inside the loop. As an aside, it is implemented in the faster way in doSort() (sort.c line 401). The example below shows the performance improvemen