I wrote an R script and tested it on my laptop. It finishes 100 iterations in about 1 minute. However I need to run this code for 10,000 iterations, so I submitted my job to run on a cluster. I expected my script to take about 100 times longer (since I use 100 times more iterations), but it looks like it runs much slower than on my local computer. Why? Here is a script I am using:

```
x <- matrix(rnorm(10000000), nrow=10000)
x[sample(1:10000000, 10000, replace=FALSE)] <- NA
# initialize res
res = NULL
n = nrow(x)
for (i in 1:n) {
if ( sum(is.na(x[i,])) < 3 ) res = rbind(res, x[i,])
}
apply(res,1,mean)
```