我在 unix(它的集群)和 Windows(intel core duo ,2Gb RAM)上运行相同的代码。我可以看到运行时间存在显着差异。我可以在 unix 中看到,它只使用一个核心,但在 Windows 上,它可能使用两个核心(我不确定)。我的担忧如下:
Windows:
user system elapsed
207.12 8.82 472.04
Unix
user system elapsed
327.765 2.493 330.819
我不明白,为什么 Windows 的 cpu 处理时间和经过的时间差异太大。我将代码分成几段,这只发生在读写部分(I/O)上,其余的计算与unix相比非常快,并且在“用户”和“经过”时间方面没有任何区别
user system elapsed
48.765 0.00 52.69
我没有做任何特别的事情,但我正在阅读大约 300mb 的非常大的文件
indata <- read.csv(mutFile, sep="\t", header = TRUE)
如何避免这种差异以提高整体性能?