s-news
[Top] [All Lists]

Re: Time management in S-Plus

To: "Herschtal Alan" <Alan.Herschtal@petermac.org>, <s-news@lists.biostat.wustl.edu>
Subject: Re: Time management in S-Plus
From: "Michael Camilleri" <MichaelCamilleri@branz.co.nz>
Date: Tue, 5 Jun 2007 09:09:47 +1200
In-reply-to: <EBF85749A3E4944EBD55E1C4C49DB53B026A33D6@PMC-EMAIL.petermac.org.au>
References: <EBF85749A3E4944EBD55E1C4C49DB53B026A33D6@PMC-EMAIL.petermac.org.au>
Thread-index: AcemRv2eeIz8MFGJS52a5HTnkySQxQApOEXg
Thread-topic: Time management in S-Plus

S+ has a few other traps when you are dealing with large processing jobs.

 

One which I discovered is that S+ 7 for windows has a limit of 1,000 objects in the Restore Data Objects. If you are creating a new object in a chapter with each iteration then after 1,000 objects S+ will dramatically slow down and basically grind to a halt, no matter how small the objects are, and no matter how much RAM you have. Avoid this kind of assignment. If you need to create new objects with each iteration then create a list object with the required number of elements, and assign the objects to the list instead.

 

This is all to do with the automatic Restore Data Objects. If you create a brand new chapter with undo specifically turned off it won’t do it, but as soon as you re-open the chapter it starts restoring objects again.

 

Personally I don’t like the data restore feature. Early versions of S+ didn’t have it, and you just got used to saving scripts and backing up important objects (which is good analysis/programming practice). When S+ became a “Windows” application we got the undo and a pile of other useless features.

 

Michael

 

branz logo

 

MICHAEL CAMILLERI BSc, MSc, PhD

BUILDING PHYSICIST

T +64 4 237 1170

DDI +64 4 237 1174

PRIVATE BAG 50908

PORIRUA CITY 5240

WWW.BRANZ.CO.NZ

 


From: Herschtal Alan [mailto:Alan.Herschtal@petermac.org]
Sent: Monday, 4 June 2007 1:24 p.m.
To: s-news@lists.biostat.wustl.edu
Subject: Time management in S-Plus

 

 

I am trying to run many iterations of a simulation in S-plus, and am finding that the time taken per iteration increases almost exponentially. I have tried to write the code as efficiently as I can, with minimal use of for loops, vector arithmetic wherever possible, and reusing datasets where feasible. I understand that this phenomenon has something to do with the paging in S-plus's memory management system. Is there any way to keep the execution time constant ?

Thanks,

 

Alan Herschtal
Biostatistician
Centre for Biostatistics and Clinical Trials
Peter MacCallum Cancer Centre
Ph: 9656 3639

<Prev in Thread] Current Thread [Next in Thread>