search for: savesize

Displaying 6 results from an estimated 6 matches for "savesize".

2016 Jul 27
2
Model object, when generated in a function, saves entire environment when saved
...t that interest you. As long as they don't include the formula (which is what drags along the environment it was created in), you will save space. E.g., tfun2 <- function(subset) { junk <- 1:1e6 list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris, subset=subset)$coef) } saveSize(tfun2(1:4)) #[1] 152 Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jul 27, 2016 at 11:19 AM, William Dunlap <wdunlap at tibco.com> wrote: > One way around this problem is to make a new environment whose > parent environment is .GlobalEnv and which contains only what the >...
2017 Apr 27
4
-msave-args backend support for x86_64
...reateDefCfaRegister( nullptr, DwarfFramePtr)); } + + if (SaveArgs) { + ArrayRef<MCPhysReg> GPRs = + get64BitArgumentGPRs(Fn->getCallingConv(), STI); + unsigned arg_size = Fn->arg_size(); + unsigned RI = 0; + int64_t SaveSize = 0; + + for (MCPhysReg Reg : GPRs) { + if (++RI > arg_size) + break; + + SaveSize += SlotSize; + +#if 1 + BuildMI(MBB, MBBI, DL, TII.get(X86::PUSH64r)) + .addReg(Reg) + .setMIFlag(MachineInstr::FrameSetup); +#else + //...
2016 Jul 27
3
Model object, when generated in a function, saves entire environment when saved
In the below, I generate a model from an environment that isn't .GlobalEnv with a large object that is unrelated to the model generation. It seems to save the irrelevant object unnecessarily. In my actual use case, I am running and saving many models in a loop that each use a single large data.frame (that gets collapsed into a small data.frame for estimation), so removing it isn't an
2016 Jul 27
0
Model object, when generated in a function, saves entire environment when saved
...include the formula (which is > what drags along the environment it was created in), you will > save space. E.g., > > tfun2 <- function(subset) { > junk <- 1:1e6 > list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris, > subset=subset)$coef) > } > > saveSize(tfun2(1:4)) > #[1] 152 > > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Wed, Jul 27, 2016 at 11:19 AM, William Dunlap <wdunlap at tibco.com> > wrote: > > > One way around this problem is to make a new environment whose > > parent env...
2016 Jul 27
0
Model object, when generated in a function, saves entire environment when saved
...he call to lm() requires and to compute lm() in that environment. E.g., tfun1 <- function (subset) { junk <- 1:1e+06 env <- new.env(parent = globalenv()) env$subset <- subset with(env, lm(Sepal.Length ~ Sepal.Width, data = iris, subset = subset)) } Then we get > saveSize(tfun1(1:4)) # see below for def. of saveSize [1] 910 instead of the 2129743 bytes in the save file when using the naive method. saveSize <- function (object) { tf <- tempfile(fileext = ".RData") on.exit(unlink(tf)) save(object, file = tf) file.size(tf) } Bill...
2020 Jan 29
2
Model object, when generated in a function, saves entire environment when saved
...hat drags along the environment it was created in), you will >> save space. E.g., >> >> tfun2 <- function(subset) { >> junk <- 1:1e6 >> list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris, >> subset=subset)$coef) >> } >> >> saveSize(tfun2(1:4)) >> #[1] 152 >> >> >> >> Bill Dunlap >> TIBCO Software >> wdunlap tibco.com >> >> On Wed, Jul 27, 2016 at 11:19 AM, William Dunlap <wdunlap at tibco.com> >> wrote: >> >> > One way around this problem is to m...