Changes between Version 6 and Version 8 of Ticket #24500


Ignore:
Timestamp:
01/30/18 14:52:42 (4 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24500

    • Property Cc vdelecroix added
    • Property Summary changed from Implement action using _act_ instead of _call_ to Implement actions using _act_ instead of _call_
  • Ticket #24500 – Description

    v6 v8  
    44
    55Work on #24247 shows that a significant amount of time is spent in `Action.__call__`. This ticket optimizes that quite a bit. It also adds documentation to `Action`.
     6
     7'''Timings''' (compared to before #24247 and #5574):
     8
     9'''GF(2^n^)^ZZ^'''
     10
     11Before:
     12{{{
     13sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20)
     14100000 loops, best of 20: 383 ns per loop
     15}}}
     16
     17After:
     18{{{
     19sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20)
     20100000 loops, best of 20: 635 ns per loop
     21}}}
     22
     23'''RDF^ZZ^'''
     24
     25Before:
     26{{{
     27sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20)
     28100000 loops, best of 20: 156 ns per loop
     29}}}
     30
     31After:
     32{{{
     33sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20)
     34100000 loops, best of 20: 185 ns per loop
     35}}}
     36
     37'''ideal^ZZ^'''
     38
     39Before:
     40{{{
     41sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20)
     4210000 loops, best of 20: 13.3 µs per loop
     43}}}
     44
     45After:
     46{{{
     47sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20)
     4810000 loops, best of 20: 14.1 µs per loop
     49}}}
     50
     51'''AA^QQ^'''
     52
     53Before:
     54{{{
     55sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20)
     5610000 loops, best of 20: 12.8 µs per loop
     57}}}
     58
     59After:
     60{{{
     61sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20)
     6210000 loops, best of 20: 16.6 µs per loop
     63}}}