| 6 | |

| 7 | '''Timings''' (compared to before #24247 and #5574): |

| 8 | |

| 9 | '''GF(2^n^)^ZZ^''' |

| 10 | |

| 11 | Before: |

| 12 | {{{ |

| 13 | sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20) |

| 14 | 100000 loops, best of 20: 383 ns per loop |

| 15 | }}} |

| 16 | |

| 17 | After: |

| 18 | {{{ |

| 19 | sage: k.<a> = GF(4, impl="ntl"); n = 2; timeit('a ^ n', number=100000, repeat=20) |

| 20 | 100000 loops, best of 20: 635 ns per loop |

| 21 | }}} |

| 22 | |

| 23 | '''RDF^ZZ^''' |

| 24 | |

| 25 | Before: |

| 26 | {{{ |

| 27 | sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20) |

| 28 | 100000 loops, best of 20: 156 ns per loop |

| 29 | }}} |

| 30 | |

| 31 | After: |

| 32 | {{{ |

| 33 | sage: a = RDF(2); n = ZZ(2); timeit('a ^ n', number=100000, repeat=20) |

| 34 | 100000 loops, best of 20: 185 ns per loop |

| 35 | }}} |

| 36 | |

| 37 | '''ideal^ZZ^''' |

| 38 | |

| 39 | Before: |

| 40 | {{{ |

| 41 | sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20) |

| 42 | 10000 loops, best of 20: 13.3 µs per loop |

| 43 | }}} |

| 44 | |

| 45 | After: |

| 46 | {{{ |

| 47 | sage: a = ZZ.ideal(2); n = ZZ(2); timeit('a ^ n', number=10000, repeat=20) |

| 48 | 10000 loops, best of 20: 14.1 µs per loop |

| 49 | }}} |

| 50 | |

| 51 | '''AA^QQ^''' |

| 52 | |

| 53 | Before: |

| 54 | {{{ |

| 55 | sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20) |

| 56 | 10000 loops, best of 20: 12.8 µs per loop |

| 57 | }}} |

| 58 | |

| 59 | After: |

| 60 | {{{ |

| 61 | sage: a = AA(8); n = 1/3; timeit('a ^ n', number=10000, repeat=20) |

| 62 | 10000 loops, best of 20: 16.6 µs per loop |

| 63 | }}} |