Commit d887e9c
Fix performance in union subtyping (#15104)
This is a performance optimisation for subtyping between two unions that
are largely the same.
Fixes #14034
This makes @adriangb's example in
#14034 (comment)
finish basically instantly. I could add it as a unit test?
Type checking pydantic core is still not fast — takes like four or five
minutes with uncompiled mypy — but at least it's now feasible. I think
there's room for doing some optimisation in make_simplified_union that
would improve this.1 parent 320b883 commit d887e9c
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
927 | 923 | | |
928 | 924 | | |
929 | 925 | | |
| |||
0 commit comments