candid
candid copied to clipboard
perf: Subtype checking should not perform quadratic traversal
The equality check performed at the beginning of subtype checking: https://github.com/dfinity/candid/blob/30c388671462aecdc4a3a9753d50dc2e8208c200/rust/candid/src/types/subtype.rs#L39-L41
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).