Opened 11 years ago

Last modified 5 years ago

#9884 needs_info defect

slow coercion of polynomial to list over integer mod ring

Reported by: dmharvey Owned by: tbd
Priority: major Milestone:
Component: performance Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by edgarcosta)

Sage 4.5.3, 2.6GHz Opteron, Linux

sage: R = Integers(3^20)
sage: S.<x> = PolynomialRing(R)
sage: f = S([R.random_element() for i in range(100)])
sage: timeit("L = f.list()")
125 loops, best of 3: 1.13 ms per loop

That's about 29000 cycles per coefficient conversion. See also #9883.

Change History (4)

comment:1 Changed 11 years ago by roed

This is sped up by about a factor of 33 by the patch at #9887. If that's positively reviewed, I would suggest closing this ticket.

comment:2 Changed 7 years ago by mmezzarobba

6.2.beta4, on an Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz:

sage: R = Integers(3^20)
sage: S.<x> = PolynomialRing(R)
sage: f = S([R.random_element() for i in range(100)])
sage: timeit("L = f.list()")
625 loops, best of 3: 166 µs per loop

So I only get a factor of ~7 wrt the timings reported by David Harvey.

David (Roe), can you please check if you still observe the same speedup or if there has been a regression in the meantime?

Last edited 7 years ago by mmezzarobba (previous) (diff)

comment:3 Changed 7 years ago by mmezzarobba

  • Status changed from new to needs_info

comment:4 Changed 5 years ago by edgarcosta

  • Description modified (diff)

Version 7.1.beta3 - Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz

sage: R = Integers(3^20)
sage: S.<x> = PolynomialRing(R)
sage: f = S([R.random_element() for i in range(100)])
sage: timeit("L = f.list()")
625 loops, best of 3: 85.8 µs per loop

a bit faster on my slightly faster cpu.

Fast enough?

Note: See TracTickets for help on using tickets.