[R] How to speed up R program

Sarah Goslee sarah.goslee at gmail.com
Mon Mar 14 23:15:43 CET 2016


Nobody can help you without a lot more information, though there are
some obvious places to start, like pre-allocating objects rather than
growing them inside a loop.

You can get a good discussion of how to profile your code here:
http://adv-r.had.co.nz/Profiling.html

Sarah

On Mon, Mar 14, 2016 at 5:55 PM, Ragia . <ragia11 at hotmail.com> wrote:
> thanks for answering
> the program is simulation it runs on data ( wish is taken from file to memory once)  but it runs about 10k times and in each mad some calculations ?
>
> hope this clear the problem,
>
>
>
> Ragia
>
>
> ----------------------------------------
>> Date: Tue, 15 Mar 2016 08:45:56 +1100
>> Subject: Re: [R] How to speed up R program
>> From: drjimlemon at gmail.com
>> To: ragia11 at hotmail.com
>> CC: r-help at r-project.org
>>
>> Hi Ragia,
>> Improving the efficiency of a program usually requires detailed
>> analysis of what it is doing and how those operations can be performed
>> more rapidly. That is to say, without knowing what the program is
>> supposed to accomplish and how it is doing it now, very little help
>> can be provided. One thing you might look for is "disk-thrashing"
>> where your storage media (e.g. hard disk) is being accessed
>> continuously. This usually indicates that the program is swapping out
>> data to the disk, which is typically slow compared to processing it in
>> memory.
>>
>> Jim
>>
>>
>> On Tue, Mar 15, 2016 at 8:32 AM, Ragia . <ragia11 at hotmail.com> wrote:
>>>
>>>
>>>
>>>
>>> Dear group
>>> I have two R sessions running on Ubuntu 14.0x server , and I found that my program will take too long time to be finished( months...!), I used top command and found that cpu usage is 21.3%.
>>>
>>> the server is Enterprise SP-64 - 64G E5-1630v3 SoftRaid 2x2 TB Server . 6 core
>>>
>>> how can I speed the program, kindly I need tutorial or book chapter that helps..
>>> thanks in advance
>>> Ragia
>>>
>>>



More information about the R-help mailing list