#15820: Implement sequences of bounded integers
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  algebra            |   Resolution:
       Keywords:  sequence bounded   |    Merged in:
  integer                            |    Reviewers:  Simon King
        Authors:  Simon King,        |  Work issues:
  Jeroen Demeyer                     |       Commit:
Report Upstream:  N/A                |  41c40cf2c59734e7e665ba9c2350da2930c9cc8e
         Branch:                     |     Stopgaps:
  u/SimonKing/ticket/15820           |
   Dependencies:  #17195, #17196     |
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Let's do some benchmarks:

 1. With the latest commit:
 {{{
 sage: from sage.data_structures.bounded_integer_sequences import
 BoundedIntegerSequence
 sage: B = BoundedIntegerSequence(2, [1]*100000)
 sage: timeit('B.list()')
 625 loops, best of 3: 965 µs per loop
 sage: timeit('list(B)')
 125 loops, best of 3: 1.73 ms per loop
 sage: B = BoundedIntegerSequence(sys.maxint, [1]*100000)
 sage: timeit('B.list()')
 625 loops, best of 3: 1.1 ms per loop
 sage: timeit('list(B)')
 125 loops, best of 3: 1.91 ms per loop
 }}}

 2. With 88e5ecaa30a54cfadbfe4fc1c0ee6d1840041ee8:
 {{{
 sage: from sage.data_structures.bounded_integer_sequences import
 BoundedIntegerSequence
 sage: B = BoundedIntegerSequence(2, [1]*100000)
 sage: timeit('B.list()')
 125 loops, best of 3: 3 ms per loop
 sage: timeit('list(B)')
 125 loops, best of 3: 3.87 ms per loop
 sage: B = BoundedIntegerSequence(sys.maxint, [1]*100000)
 sage: timeit('B.list()')
 125 loops, best of 3: 3.68 ms per loop
 sage: timeit('list(B)')
 125 loops, best of 3: 4.47 ms per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/15820#comment:269>
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