performance - R only using 13% of my processor -
system:
os - windows 7
ram - 8gb
processor - intel i7
r version - always keep up-to-date
problem:
r using 13% (i.e. 1 out of 8 cores) of intel i7 processor. want tap multiple cores running code faster. unfortunately unable to.
attempts:
started using parallel, snow, snowfall packages, configured them use 8 cores, unfortunately, i'm not using of apply functions make use of custom functions provide (like mcapply, sflapply).
for (i in 1:number.of.accounts){ if (is.na(s$rev2012[i]) == "false" && is.na(s$rev2013[i]) == "true"){ loss = rbind(loss, s[i,]) } x = x + 1 } the data frame "s" in above code has 56,000 rows 14 columns. "rev" stands revenue. i'm trying is, if there revenue in 2012, not in 2013, "lost" customer. i'm using "x" keep count on speed.
this piece of code takes ton of time run, , i've not yet let finish. when interrupt, see not has progressed.
any in unlocking cores run piece of code great.
thanks!
because r not natively support parallel processing, have add boilerplate script make utilize 8 cores.
check out doparallel package. here vignette showing how use doparallel package. also, see this question how use chunking speed performance.
that require use foreach loop, can parallelized %dopar%, instead of for loop.
Comments
Post a Comment