#16879: OA caching in C
-------------------------------------+-------------------------------------
       Reporter:  ncohen             |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorial      |   Resolution:
  designs                            |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:  Nathann Cohen      |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  public/16879       |  f13a4fd01da823289aedecf029277f515eac29f2
   Dependencies:  #16875             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:4 ncohen]:
 > Yo !
 >
 > > I am not confident of having everything switched into Cython.
 >
 > I don't like it either. And it takes a lifetime to compile.
 >
 > > It is much harder to debug and can also makes things slower.
 >
 > Really ? Do you have an example ? `O_o`

 Almost anything:
 {{{
 def f():
     from sage.rings.arith import is_prime
     from sage.quadratic_forms.extras import is_triangular_number

     for i in range(2,1000):
         is_prime(i)
         is_triangular_number(i)
 }}}
 then I got
 {{{
 sage: timeit("f_python()", number=100)
 100 loops, best of 3: 12.7 ms per loop
 sage: timeit("f_cython()", number=100)
 100 loops, best of 3: 12.9 ms per loop
 }}}
 Not very significant, but still.

 > > Why not only switch to C for the cache part?
 >
 > Well, I can't cimport a cdef function in a .py file, but perhaps that
 does not matter. I will move th caching code to designs_pyx.

 That's why we can move `orthogonal_array` as well.

 > > The function `orthogonal_array` might also move and we might also
 recreate the `orthogonal_array_available` from #16875.
 >
 > I am thinking about that. What is the difference between this
 `orthogonal_array_available` and the current `orthogonal_array` ? I don't
 talk about the user interface, just about speed. When the answer is cached
 (most frequent case), what is it that `orthogonal_array_is_available` does
 that `orthogonal_array` does not ? Only check that `k is not None` ?

 If `orthogonal_array` is cythonized... not much. Otherwise, function
 calls.

 Vincent

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