I hope you are right, as that would be good news -- it used to have greater overheads. On the other hand, in your tests you were reusing the same large finite field many times, and using large fields, wheras the typical case for me (e.g. for evaluating L-functions) is to get E.ap(p) for all p up to some bound, hence thousands of finite fields being constructed by negligible time for the point-counting. Secondly, in the number field case the finite fields are constructed as residue fields which are slower (I think) than forming an abstract GF(q).
John On 17 September 2014 10:09, Luca De Feo <[email protected]> wrote: >> A related comment, though slightly tangential: for elliptic curves E >> over QQ we can do E.ap(p) to count points on E mod p without going via >> the construction of a Sage finite field, which is important for speed. > > Is it really ? > > > sage: p = next_prime(2^10); K = GF(p) > sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 100 loops, best of 3: 15.3 ms per loop > sage: %timeit -r3 -n100 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 100 loops, best of 3: 16.1 ms per loop > > sage: p = next_prime(2^20); K = GF(p) > sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 100 loops, best of 3: 17 ms per loop > sage: %timeit -r3 -n100 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 100 loops, best of 3: 16.3 ms per loop > > sage: p = next_prime(2^30); K = GF(p) > sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 100 loops, best of 3: 19.7 ms per loop > sage: %timeit -r3 -n100 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 100 loops, best of 3: 21.9 ms per loop. > > sage: p = next_prime(2^40); K = GF(p) > sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 100 loops, best of 3: 43.1 ms per loop > sage: %timeit -r3 -n100 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 100 loops, best of 3: 48.5 ms per loop > > sage: p = next_prime(2^50); K = GF(p) > sage: %timeit -r3 -n10 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 10 loops, best of 3: 115 ms per loop > sage: %timeit -r3 -n10 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 10 loops, best of 3: 110 ms per loop > > sage: p = next_prime(2^60); K = GF(p) > sage: %timeit -r3 -n10 EllipticCurve(j=QQ.random_element(p,1)).ap(p) > 10 loops, best of 3: 235 ms per loop > sage: %timeit -r3 -n10 > EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality() > 10 loops, best of 3: 224 ms per loop > > > In any case, it seems to me that the supposed speed gain is drown in the > noise. > > Luca > > -- > You received this message because you are subscribed to the Google Groups > "sage-nt" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send an email to [email protected]. > Visit this group at http://groups.google.com/group/sage-nt. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-nt" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. Visit this group at http://groups.google.com/group/sage-nt. For more options, visit https://groups.google.com/d/optout.
