30.5. Performance
Coordinate arithmetic scales with the dimension D of the tower: addition is
linear, multiplication quadratic, and inversion runs an extended gcd over the
field below. The composite operations mix factoring, root isolation and
adjoining, whose relative weights change with the degree, so they are recorded
on fixed inputs rather than as asymptotics.
operation | input | time |
|---|---|---|
|
| 311 ms |
|
| 18 ms |
|
| 5.2 ms |
|
| 9.2 ms |
|
| 60 ms |
|
| 21 ms |
inversion |
dimension 24, | 7.0 ms |
Per-call medians on chungus2 from the exports recorded in
reports/hex-number-field-tower-performance.md in the hex-dev repository;
regenerate with .lake/build/bin/hexnumberfieldtower_bench run
Hex.NumberTowerBench.<target>. Factoring over a number field is far slower
than PARI's nffactor on the same inputs (twenty-two to forty-six times on
the Selmer family Xⁿ − X − 1 over ℚ(√2), at n = 2 and n = 12
respectively); the report records the comparison and its provenance.