Commit fc1e05e
committed
perf(relationships): pre-index processQueries relationship lookups
Relationships::processQueries() ran array_filter() over all
relationships once per dotted Select value to find the relationship
matching a given key, costing O(values * relationships) per call.
Build a key -> Document map once at the top so each lookup is O(1)
instead.
phpstan baseline updated to drop the now-unused array_filter ignore and
to reduce one Relationship::fromDocument count that the new map type
makes provable.1 parent e8cd9da commit fc1e05e
2 files changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | 900 | | |
907 | 901 | | |
908 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
919 | 930 | | |
920 | 931 | | |
921 | 932 | | |
| |||
931 | 942 | | |
932 | 943 | | |
933 | 944 | | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
| 945 | + | |
938 | 946 | | |
939 | 947 | | |
940 | 948 | | |
| |||
0 commit comments