Like many, I suspect, I was a little concerned about whether recent Windows updates to address Meltdown and Spectre would have a significant adverse effect on calculation time in R. I do quite a lot of survival analysis using large(ish) data sets, which already takes a long time. Unfortunately it only occurred to me after updating my main PC, so decided to do a little benchmarking using an old one, both before and after the relevant Windows update. The results were quite interesting.
test replications elapsed relative user.self sys.self
Pre-Update 100 287.31 1 281.41 5.68
PostUpdate 100 334.71 1 290.42 44.27
PostUpdate 100 338.9 1 294.22 44.5
The increase in elapsed time is irritating but manageable. What is really striking is this slowdown is mostly due to nearly 8 fold increase in system time. Is this expected? Has anyone else done a similar exercise? It would be interesting to know the range of the impact others are experiencing, since I only did this with one particular type of calculation that is a bottleneck in some of my work, and other calculations may suffer more. I appreciate that is is pushing the boundaries of the type of question stackoverflow is intended for, but since this is likely to affect almost everyone, answers sharing experience might be useful.
Just a bit of background context: I ran these tests with as few other processes as possible running.
- Processor: i5-2500 (no microcode update obviously!)
- OS: Windows 7, pre and post update KB4056897
- R version 3.4.3
And just for completeness, the code run is:
library("survival")
library("rbenchmark")
set.seed(42)
n = 1e6
censTimes <- seq(from = 0, to = 1, length.out = n)
failTimes <- rweibull(n, 1, -1/log(0.9))
Event <- failTimes < censTimes
obsTimes <- ifelse(Event, failTimes, censTimes)
survObj <- Surv(obsTimes, Event)
Group <- rbinom(n, 4, 0.5)
benchmark(coxph(survObj ~ Group))