baseball data may be too small to see improvement, making the calculations parallel; The overhead of transferring data to different processes may depend on any acceleration by performing parallel computations. Using the rbenchmark package:
baseball10 <- baseball[rep(seq(length=nrow(baseball)), 10),] benchmark(noparallel = ddply(baseball, .(year), numcolwise(mean)), parallel = ddply(baseball, .(year), numcolwise(mean), .parallel=TRUE), noparallel10 = ddply(baseball10, .(year), numcolwise(mean)), parallel10 = ddply(baseball10, .(year), numcolwise(mean), .parallel=TRUE), replications = 10)
gives results
test replications elapsed relative user.self sys.self user.child sys.child 1 noparallel 10 4.562 1.000000 4.145 0.408 0.000 0.000 3 noparallel10 10 14.134 3.098203 9.815 4.242 0.000 0.000 2 parallel 10 11.927 2.614423 2.394 1.107 4.836 6.891 4 parallel10 10 18.406 4.034634 4.045 2.580 10.210 9.769
With a 10x data set, the parallel penalty is less. A more complex calculation would also deflect him even further, which would probably give him an edge.
This was done on a Mac OS X 10.5.8 Core 2 Duo machine.
source share