At the heart of probablePrime()
is a series of Miller-Rabin tests (The number of rounds performed depends on the bit size of the number) combined with a Lucas-Lehmer primality test. The time complexity of these depend quite a bit on the rest of the BigInteger
implementation. Taking in "slow" estimates from wikipedia would be O(k log(n)^3) and O(log(n)^3) respectively.
On the other hand, the AKS-primality test, without unproven conjectures, can run in Õ(log(n)^6).
So assuming your numbers are large enough, the probabilistic test can be quite a bit faster than a deterministic one. For anything large enough for cryptography the asymptotic behaviour is quite likely observable. Of course, the only way to find out for certain is to implement the modified AKS and time the results.
(k
is the number of cycles in Mille-Rabin).