Ticket #9883 (new defect)

Opened 3 years ago

Last modified 3 years ago

slow coercion of list to polynomial over integer mod ring

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

Description

Sage 4.5.3, 2.6GHz Opteron, Linux:

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

That's about 124000 cycles per coefficient conversion. Compare to the cost of multiplying polynomials of the same degree:

sage: f = S([R.random_element() for i in range(100)])
sage: g = S([R.random_element() for i in range(100)])
sage: timeit("h = f * g")
625 loops, best of 3: 31.8 µs per loop

Change History

comment:1 Changed 3 years ago by roed

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

Note: See TracTickets for help on using tickets.