Alex Ghitza wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,

Hello,

>
> I just noticed that this ticket was closed as fixed.  To quote trac:
>
> - -----------------------------------------------------
> I guess this has been fixed. With Sage 2.8.2 I get:
>
> sage: E = EllipticCurve([GF(101)(1),3])
> sage: P = E([-1,1,1])
> sage: timeit 2*P
> 1000 loops, best of 3: 317 µs per loop
> sage: timeit P+P
> 10000 loops, best of 3: 92.7 µs per loop
> - -----------------------------------------------------
>
> I'm confused: this says that 2*P still takes 3 times as long as P+P to
> do the same thing -- I thought this was the problem in the first place?

After rereading the ticket I see the same problem as you do. I was the
one who recommended to William to close that ticket, so my bad. The
ratio of "P+P" to "2*P" has actually gotten worse from the time the
bug report was filed, even though the operation itself has improved.

The question is: Just because something is mathematically equivalent
should it take the same time in an actual implementation? How do other
CASs fare in this particular case? Can we fix the problem in Sage?

And on that note if you go away from the factor 2 and double it fairly
soon you reach a crossover point where the situation is reversed:

sage: E = EllipticCurve([GF(101)(1),3])
sage: P = E([-1,1,1])

sage: timeit 5*P
1000 loops, best of 3: 444 µs per loop
sage: timeit P+P+P+P+P
1000 loops, best of 3: 367 µs per loop

sage: timeit 10*P
1000 loops, best of 3: 534 µs per loop
sage: timeit P+P+P+P+P+P+P+P+P+P
1000 loops, best of 3: 373 µs per loop

sage: timeit 20*P
1000 loops, best of 3: 617 µs per loop
sage: timeit P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P
1000 loops, best of 3: 719 µs per loop

sage: timeit 40*P
1000 loops, best of 3: 712 µs per loop
sage: timeit P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P+P
+P+P+P+P+P+P+P+P+P+P+P
100 loops, best of 3: 1.93 ms per loop

Now I know that this is silly to some extend to try this with n=20 or
higher. But I guess it illustrates a point.

The question now is: Should we reopen the ticket? If so we certainly
should change the description.

Cheers,

Michael
>
> Cheers,
> Alex
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGzheFdZTaNFFPILgRAhJdAJ9PZTrp7IxfCgBQdlV7VNjfqhPm+ACgp9k9
> hiR5+zYmUsxKgb9djms3sEk=
> =hq2x
> -----END PGP SIGNATURE-----


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to