Is there any chance to write a faster GCD than the built-in one in Mathematica?
@Mr.Wizard has written one in this question (although it's not for this purpose) which is 6 times slower on a 100k digits:
In[1]:= whileGCD=Module[{a=#,b=#2},While[b!=0,{a,b}={b,Mod[a,b]}];a]&;
In[2]:= Primo[n_]:=Product[i,{i,Prime[Range[n]]}]
In[10]:= prod=Primo[500000];
In[17]:= m=22Primo[20500] +1;
In[16]:= Timing[GCD[m,prod]]
Out[16]= {0.25,1}
In[12]:= Timing[whileGCD[m,prod]]
Out[12]= {1.609,1}