Changes between Version 11 and Version 27 of Ticket #24500


Ignore:
Timestamp:
11/26/18 11:41:26 (3 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24500

    • Property Dependencies changed from #5574 to
    • Property Commit changed from f2b676ef4e7b13eb4e14f117d39afb8b06ebdc03 to 3a0958dcb4da8ee91b28163172061666de38bd01
  • Ticket #24500 – Description

    v11 v27  
    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 Note: "before" timings are without #24247, #5574 and #24500. "after" timings are with #24247, #5574 and #24500.
    10 
    11 '''GF(2^n^)^ZZ^'''
    12 
    13 Before:
    14 {{{
    15 sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20)
    16 100000 loops, best of 20: 383 ns per loop
    17 }}}
    18 
    19 After:
    20 {{{
    21 sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20)
    22 100000 loops, best of 20: 635 ns per loop
    23 }}}
    24 
    25 '''RDF^ZZ^'''
    26 
    27 Before:
    28 {{{
    29 sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20)
    30 100000 loops, best of 20: 156 ns per loop
    31 }}}
    32 
    33 After:
    34 {{{
    35 sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20)
    36 100000 loops, best of 20: 185 ns per loop
    37 }}}
    38 
    39 '''ideal^ZZ^'''
    40 
    41 Before:
    42 {{{
    43 sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20)
    44 10000 loops, best of 20: 13.3 µs per loop
    45 }}}
    46 
    47 After:
    48 {{{
    49 sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20)
    50 10000 loops, best of 20: 14.1 µs per loop
    51 }}}
    52 
    53 '''AA^QQ^'''
    54 
    55 Before:
    56 {{{
    57 sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20)
    58 10000 loops, best of 20: 12.8 µs per loop
    59 }}}
    60 
    61 After:
    62 {{{
    63 sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20)
    64 10000 loops, best of 20: 16.6 µs per loop
    65 }}}