Skip to content

[Medium] NondominatedRunSurface redundantly recomputes the frontier it was just built from #35

Description

@gratus907

Severity: Medium (performance)

NondominatedRunSurface.__post_init__ redundantly recomputes the full frontier that from_records just computed, plus a fully redundant O(F·N) deep-equality membership check that's already implied by the frontier-equality check that follows.

Locationsrc/variopt/artifacts/terminal.py:673-683 (post_init) vs from_records at line 748

Measured: N=2000 all-nondominated records → 5.95s to construct one surface (Python-level pairwise dominates_objective_scores, executed roughly 3x the necessary amount). N=10k would take minutes.

Fix direction

Pass a "prevalidated" marker from from_records to skip re-verification when constructed through the trusted path (mirroring the _validated_refinement_pairs identity-cache pattern already used for refinements elsewhere in the same module), delete the redundant membership loop, and hoist the double zip in dominates_objective_scores into a single pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions