Skip to content

perf: Subtype checking should not perform quadratic traversal #603

Description

@christoph-dfinity

The equality check performed at the beginning of subtype checking:

if t1 == t2 {
return Ok(());
}

should only do a cheap check for "physical" equality (using ptr_eq on anything non-primitive).

Otherwise we do full traversals of complex nested types at every level (quadratic).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions