Skip to content

Centralize power caching in _pylong.py #118610

Description

@tim-one

Proposal:

A number of functions in _pylong.py craft their own schemes to cache costly ** results. This complicates their code, and all of them end up doing more work than necessary.

So I want to add a new internal compute_powers() function that computes all and only the powers needed in advance, and returns a dict recording the results. It should speed things, but not by much (the time is dominated by how long it takes to compute the single largest power needed). The real point is code simplification.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions