Giora Simchoni Giora Simchoni - 1 month ago 18
R Question

Why is R slower on my (stronger) Desktop than on my (weaker) laptop?

I'm using a Dell Latitude E7440 Laptop with Windows 7 Enterprise OS, 8GB RAM, 64-bit OS, Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz Processor, 2701 Mhz, 2 Cores, 4 Logical Processors (that's 4 cores).

I'm using a Dell Precision Tower 7810 Desktop with Windows 7 Enterprise OS, 32GB RAM, 64-bit OS, Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz 2 Processors, 2401 Mhz, 6 Cores, 12 Logical Processors (that's 24 cores).

A good demonstration of my use of R would be running binary classification using

gbm
in RStudio on 100K-sized data with ~300 features. But whatever I do on my laptop R version (all other software closed, no use of parallelization), is considerably faster than on my Desktop R version. How can that be? What do I need to do to find out?

Laptop:

> sum <- 0; system.time(for (i in 1:1000000) sum <- sum + i)
user system elapsed
0.36 0.00 0.36
> memory.limit()
[1] 8097
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] tools_3.3.1


Desktop:

> sum <- 0; system.time(for (i in 1:1000000) sum <- sum + i)
user system elapsed
0.52 0.00 0.52
> memory.limit()
[1] 32684
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] tools_3.3.1

Answer

Dell Latitude E7440 Laptop ... i7-4600U CPU @ 2.10GHz Processor, 2701 Mhz

Dell Precision Tower 7810 Desktop ... E5-2620 v3 @ 2.40GHz 2 Processors, 2401 Mhz

That would be why. Your laptop's CPU is running at a faster physical clock speed than your desktop, hence R also runs faster.

In the absence of multithreaded BLAS or other parallel-processing tricks, having multiple cores won't affect matters. Similarly, as long as you have enough memory to hold your data, more gigabytes won't speed things up (excepting caching issues but 100K should easily fit into the cache on both machines).