Various speed improvements to polynomial factorization and the GAP meataxe #720
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While investigating the recog package together with Alice Niemeyer and Frank Lübeck last week, I came up with some tweaks to GAP that improved the recognition speed for some examples considerably.
First example: The following went from about 5.5 seconds to about 2.1 seconds on my laptop:
Second example: The following went from about 78 milliseconds to 10ms. Over larger fields, it is not quite as dramatic, but still noticable (e.g. over GF(3), it went from 55ms to 13ms, and over GF(17) from 62ms to 39ms).
There are more optimization opportunities in the meataxe code. For example, it compute characteristic polynomials, then factors them. But the code for computing characteristic polynomials actually does so by first computing factors, then multiplying them... The obvious idea then is to provide a function which directly returns those factors (they won't be irreducible in general, but certainly still easier to factorize than the full char poly). Indeed, I noticed that the cvec package defines a method for that:
FactorsOfCharacteristicPolynomial
. Perhaps something like this should be added to GAP itself?