We can see that timings for FrobeniousSolve are roughly 20-40 % better than for the Solve over Primes approach :

cfs[[18 ;;, 2]]
spp[[18 ;;, 2]]

{0.702000, 0.412000, 0.412000}
{0.866000, 0.576000, 0.591000}

The larger numbers we deal with the better is the FroneniousSolve approach. This issue is even clearer if we have more variables.
The oscillating pattern of the above plots of timings is coupled to the number of prime solutions $(m, n)$ to this equation $m + n = k\;$ for any integer $k$.

@Rojo Good point, however I prefer FrobeniusSolve rather than IntegerPartitions since the latter yields solutions without ordering, i.e. there are only {a,b} pairs unlike in the former {a,b} and {b,a}.
–
ArtesDec 1 '12 at 20:55

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.