Skip to content

math/big: improve threshold calibration #25580

@alexd765

Description

@alexd765

For multiplication and squaring we use different algorithms depending on the input length. We currently have 3 threshold constants to decide which algorithm to use. These are calibrated with TestCalibrate.

This calibration takes multiple minutes to run and the outcome doesn't seem to be that reliable. Last noticed in cl 105075.

Quote @griesemer :

On my machine, the threshold is much lower (less than 200). At some point we need to find a better way to determine these values.

I see three issues:

  1. Reliable result on a single machine: this worked on my machine, but didn't for @ALTree.
  2. Similar results on different machines: for calibrating karatsubaSqrThreshold we got differences of more than 100% between our 3 machines
  3. Slowness. This might be less important, but if this wouldn't take multiple minutes where you shouldn't run other programs it might be easier to ask more people to run the calibration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performance

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions