#9885: slow coercion from integer mod ring to integer ring
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:  tbd
  dmharvey               |       Status:  needs_review
           Type:         |    Milestone:
  defect                 |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  performance            |  Work issues:
       Keywords:         |       Commit:
        Authors:  Nils   |  c04c8b5cd99d9614d52dc65df8bb1b07a497ff5a
  Bruin                  |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/nbruin/9885          |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by mmezzarobba):

 Looks like we have been working on the issue at the same time! My go at it
 is at `u/mmezzarobba/9885-intmod_to_int`. And I get:
 * with `develop`:
   {{{
   sage: R = Integers(3^20); u = R(2)
   sage: %timeit u.lift()
   10000000 loops, best of 3: 106 ns per loop
   sage: %timeit Integer(u)
   1000000 loops, best of 3: 466 ns per loop
   }}}
 * with your patch:
   {{{
   sage: %timeit Integer(u)
   1000000 loops, best of 3: 327 ns per loop
   }}}
 * with mine:
   {{{
   sage: %timeit Integer(u)
   1000000 loops, best of 3: 289 ns per loop
   }}}
 So apparently my version is slightly faster... at least on this particular
 example.

--
Ticket URL: <http://trac.sagemath.org/ticket/9885#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to