s-news
[Top] [All Lists]

Re: Time management in S-Plus

To: <Alan.Herschtal@petermac.org>, <s-news@lists.biostat.wustl.edu>
Subject: Re: Time management in S-Plus
From: <Bill.Venables@csiro.au>
Date: Mon, 4 Jun 2007 16:51:56 +1000
Domainkey-signature: s=email; d=csiro.au; c=nofws; q=dns; b=r8iz01eoeU+ZSHTnm8CdGjvIqtMHCd6FXGRUgoTsJ4cRJhk9bfPPrclSKKhVg/dRZUiGwwPe4WqwYP/xs1nBaUB3z6l9J1ZPijNdoTa1SC7NaCDy03IGD6Y7zasgpvl0;
References: <EBF85749A3E4944EBD55E1C4C49DB53B026A33D6@PMC-EMAIL.petermac.org.au>
Thread-index: AcemRv2eeIz8MFGJS52a5HTnkySQxQALWqCg
Thread-topic: [S] Time management in S-Plus
 
How are you doing the iterations?  Are you using a for-loop or are you using a batch script with the loop unrolled into explicit code?  I have found that the latter can be very effective for large calculations.  The technique is essentially to get S-PLUS itself to do the unrolling by language manipulatons, sink the result to a file and then use the file as a batch script. 
 
Bill Venables.


From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Herschtal Alan
Sent: Monday, 4 June 2007 11:24 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] 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>