Skip to content

perf: Subtype checking should not perform quadratic traversal #603

@christoph-dfinity

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).

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