Repository navigation
Commit ee41271
committed
Count intersection property names with a plain map and slice
Deciding whether an intersection reduces to never counts how many
constituents declare each property name. The ordered map used for
this is a general-purpose structure that does more bookkeeping per
operation than this hot path needs, and each property costs a lookup
and an assignment. On mui-docs this shows up as a few percent of
single-checker time.
Count into a slice of entries indexed by a plain string map instead.
The slice keeps first-occurrence order for the reduction check, and
the first constituent's names are inserted without a lookup since
property names are already unique within a type.
│ old │ new │
│ sec/op │ sec/op vs base │
Tsc/bluesky 3.179 ± 1% 3.133 ± 1% -1.45% (p=0.039 n=6)
Tsc/sentry 12.90 ± 7% 12.77 ± 17% ~ (p=0.818 n=6)
Tsc/t3code-server 16.85 ± 3% 16.80 ± 3% ~ (p=0.937 n=6)
Tsc/mui-docs 8.536 ± 3% 8.152 ± 1% -4.50% (p=0.002 n=6)
geomean 8.763 8.604 -1.81%
│ old │ new │
│ rss-B │ rss-B vs base │
Tsc/bluesky 1.439Gi ± 2% 1.417Gi ± 1% ~ (p=0.093 n=6)
Tsc/sentry 4.566Gi ± 4% 4.504Gi ± 4% ~ (p=0.937 n=6)
Tsc/t3code-server 4.488Gi ± 5% 4.344Gi ± 9% ~ (p=0.485 n=6)
Tsc/mui-docs 3.535Gi ± 4% 3.391Gi ± 4% ~ (p=0.065 n=6)
geomean 3.195Gi 3.114Gi -2.55%
│ old │ new │
│ heap-B │ heap-B vs base │
Tsc/bluesky 1.153Gi ± 0% 1.152Gi ± 0% ~ (p=0.394 n=6)
Tsc/sentry 3.620Gi ± 0% 3.622Gi ± 0% ~ (p=0.485 n=6)
Tsc/t3code-server 3.761Gi ± 0% 3.762Gi ± 0% ~ (p=0.310 n=6)
Tsc/mui-docs 2.641Gi ± 0% 2.641Gi ± 0% ~ (p=0.818 n=6)
geomean 2.537Gi 2.537Gi +0.01%1 parent 5237fd4 commit ee41271
3 files changed
Lines changed: 76 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22321 | 22321 | | |
22322 | 22322 | | |
22323 | 22323 | | |
22324 | | - | |
| 22324 | + | |
| 22325 | + | |
| 22326 | + | |
| 22327 | + | |
| 22328 | + | |
| 22329 | + | |
| 22330 | + | |
22325 | 22331 | | |
22326 | | - | |
| 22332 | + | |
22327 | 22333 | | |
22328 | 22334 | | |
22329 | 22335 | | |
22330 | 22336 | | |
22331 | | - | |
22332 | | - | |
22333 | | - | |
| 22337 | + | |
| 22338 | + | |
| 22339 | + | |
22334 | 22340 | | |
22335 | 22341 | | |
22336 | 22342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
310 | 317 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
315 | 322 | | |
316 | 323 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | | - | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
329 | 336 | | |
330 | 337 | | |
331 | 338 | | |
332 | 339 | | |
333 | 340 | | |
334 | | - | |
| 341 | + | |
335 | 342 | | |
336 | | - | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| |||
364 | 371 | | |
365 | 372 | | |
366 | 373 | | |
367 | | - | |
| 374 | + | |
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
933 | 932 | | |
934 | 933 | | |
935 | 934 | | |
| 935 | + | |
936 | 936 | | |
937 | | - | |
938 | | - | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
939 | 979 | | |
940 | 980 | | |
941 | 981 | | |
| |||
0 commit comments