#19585: Improve efficiency of calling GAP functions
-------------------------------------+-------------------------------------
       Reporter:  jaanos             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.10
      Component:  interfaces         |   Resolution:
       Keywords:  GAP functions      |    Merged in:
  interface                          |    Reviewers:
        Authors:  Janoš Vidali       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  62bd5710559065d03a64aed7b8611cdc6842b278
  u/jaanos/improve_efficiency_of_calling_gap_functions|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Jano\u0161 Vidali', 'oldvalue': ''}):

 * status:  new => needs_review
 * author:   => Janoš Vidali
 * component:  PLEASE CHANGE => interfaces
 * keywords:   => GAP functions interface
 * commit:   => 62bd5710559065d03a64aed7b8611cdc6842b278
 * type:  PLEASE CHANGE => enhancement


Old description:



New description:

 When calling a GAP function, the current code outputs its result twice for
 each call - first time when the function is called, and once again when
 checking whether the function actually returned something. Then, when the
 result is actually needed, it is once again read from the variable storing
 it.

 This ticket removes the first two outputs, thus greatly speeding up the
 (still slow) GAP interface. The first output is dealt with by `;;`, which
 suppresses outputting the result, but not any explicitly printed output
 (which is caught when the function doesn't actually return anything). The
 second output, which would be printed and compared with the marker, is now
 stored in an auxiliary variable, which is then compared with the marker
 using GAP's `IsIdenticalObj` function (which will also give the correct
 result in the unlikely case when the function returns `"__SAGE_LAST__"`,
 except in the even more unlikely case when it returns the marker object
 itself).

 The speedup achieved by this fix can be quite dramatic. For example,
 calling `A.conjugacy_classes_subgroups()` for a permutation group `A` of
 order 2000 took about 20 seconds on my laptop, but this is now cut down to
 under 10 seconds (which is still slower than it needs to be, IMO).

--

Comment:

 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=62bd5710559065d03a64aed7b8611cdc6842b278
 62bd571]||{{{Flip the switch from "magic" to "more magic":)}}}||

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