Skip to content

Avoid repeated traversal of tree in History construction #1139

Closed

Description

@tturocy

The History objects used in the new H-selector construction API are rebuilt recursively with no sharing between calls - so in effect selection is exponential when it needs only to be linear (in the depth of the tree).

The crux of this is that _history_of(node) walks back to the root and calls _canonical_history to fill in the history transition - but _canonical_history calls history_of again.

The proposed fix is that canonical-history construction should be memoised.

Activity

  1. added this to the gambit-17.0.0 milestone on Sep 15, 2026
  2. self-assigned this
    on Sep 15, 2026
  3. added
    pythonItems which involve coding in Python
    cythonItems which involve coding in Cython
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cythonItems which involve coding in CythonpythonItems which involve coding in Python

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions