This package has a fast factoring function.

https://github.com/jlapeyre/PrimeSieve.jl

But it uses an external library. The code mentioned by Steven Johnson
is probably much faster (in general) than the current Julia code, but slower
than the code in PrimeSieve. But, the new code is a great step in the right 
direction
because it is in native Julia.



On Saturday, May 23, 2015 at 6:35:48 PM UTC+2, harven wrote:
>
> The factor function seems to be slow.
>
>         julia> @time factor(147573952589676412927)   # 2^67-1;  Cole
>       elapsed time: 4.955545116 seconds (6 MB allocated, 6.82% gc time in 
> 1 pauses with 0 full sweep)
>       Dict{Int128,Int64} with 2 entries:
>         761838257287 => 1
>         193707721    => 1
>
> This is even worse if a bigint is taken as argument (e.g. big(2)^67-1).
> In contrast, here is the timing for the unix factor utility (instant)
>
>       $ time factor 147573952589676412927
>       147573952589676412927: 193707721 761838257287
>
>       real    0m0.043s
>       user    0m0.000s
>       sys     0m0.004s
>
> Is there a way to speed up the factorisation with julia?
>

Reply via email to