Slug #884
DistrMPolyInlPP::myPushFront and DistrMPolyInlPP::myPushBack inefficient if arg is a PP
Description
In the class DistrMPolyInlPP
the mem fns myPushFront
and myPushBack@ can accept raw coeff and raw pp, BUT the impl then "explodes" the PP into a vector of exponents then calls the myPushFront
or myPushBack
mem fns on the vector. This is rather inefficient!
Find a way to copy the aleady encoded PP!
Related issues
History
#1 Updated by John Abbott almost 8 years ago
I wrote a special reading fn for polynomials (using a "private" linearization). It was not as fast as I hoped, and profiling showed that a lot of time was spent in DistrMPolyInlPP::myPushFront
.
Looking at the code I saw that it "explodes" the PP into an expv, and then recompresses it into an ordv. This is a perceptible waste of time!
The source code for myPushFront
contained a commented-out line calling a straight assignment; activating the line triggered a compilation error. The problem is that the PP which is passed in is of type PPMonoidElemConstRawPtr
but the assignment wants a const OrdvElem*
. How to do what I want reasonably cleanly and safely?
#2 Updated by John Abbott almost 8 years ago
- Related to Slug #881: ReadExpr is too slow on large polys added