gpt4 book ai didi

r - 为什么 R 在我的(较强的)台式机上比在我的(较弱的)笔记本电脑上慢?

转载 作者:行者123 更新时间:2023-12-01 23:10:29 25 4
gpt4 key购买 nike

我使用的是 Dell Latitude E7440 笔记本电脑,配备 Windows 7 Enterprise 操作系统、8GB RAM、64 位操作系统、Intel(R) Core(TM) i7- 4600U CPU @ 2.10GHz 处理器,2701 Mhz,2 核,4 个逻辑处理器(即 4 核)。

我使用的是 Dell Precision Tower 7810 台式机,配备 Windows 7 Enterprise 操作系统、32GB RAM、64 位操作系统、Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz 2 处理器,2401 Mhz,6 核,12 个逻辑处理器(即 24 核)。

我对 R 的使用的一个很好的演示是在 RStudio 中使用 gbm 对具有约 300 个特征的 100K 大小的数据运行二进制分类。但无论我在笔记本电脑 R 版本上做什么(关闭所有其他软件,不使用并行化),都比我的桌面 R 版本快得多。怎么可能?我需要做什么才能找到答案?

笔记本电脑:

> 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

桌面:

> 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

最佳答案

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

这就是原因。您的笔记本电脑的 CPU 的物理时钟速度比台式机的运行速度更快,因此 R 的运行速度也更快。

在没有多线程 BLAS 或其他并行处理技巧的情况下,拥有多个核心不会影响问题。同样,只要您有足够的内存来保存数据,更多 GB 不会加快速度(缓存问题除外,但 100K 应该可以轻松放入两台计算机上的缓存中)。

关于r - 为什么 R 在我的(较强的)台式机上比在我的(较弱的)笔记本电脑上慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40258467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com