(*Here is an comparison*)
data = {};
For[n = 1, n < 10, n++,
t1 = Timing[ParallelSum[1/i^2, {i, 1, n*100000}]];
t2 = Timing[HarmonicNumber[n*100000, 2]];
AppendTo[data, {t1[[1]], t2[[1]]}]]
data
The result is as following which shows the built-in functions always win here.
{{0.432000, 0.192000}, {0.896000, 0.500000}, {1.476000,
0.860000}, {2.228000, 1.236000}, {3.048000, 1.664000}, {3.956000,
2.128000}, {4.920000, 2.540000}, {5.932000, 2.936000}, {7.140000,
3.492000}}
The question is: If we rewrite a built-in function with parallelized functions, e.g. rewrite
HarmonicNumber[n*100000, 2]
as
ParallelSum[1/i^2, {i, 1, n*100000}]
Could we win (in more general case)? If not, then why? And what is the advantage of parallelization? Any help will be appreciated!