Repository navigation
Commit ffa0b32
committed
fix(py-lsp): walk each lambda body at most once per call chain
py_emit_call_for re-walked a called lambda's body without tracking lambdas
already being walked, so a lambda that reaches itself was re-walked once per
nesting level up to the walk-depth cap, doubling with two calls per body.
mpmath's calculus/extrapolation.py grows memory at about 1.9 GB/s until it is
killed. Mark the registry entry as expanding during its re-walk and skip
re-entry.
The mpmath file now indexes in 1.1 s at about 80 MB peak RSS; the graph of
the Python 3.14 stdlib + site-packages is byte-identical.
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>1 parent 2278498 commit ffa0b32
3 files changed
Lines changed: 72 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
696 | | - | |
697 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
698 | 700 | | |
699 | | - | |
| 701 | + | |
700 | 702 | | |
701 | 703 | | |
702 | | - | |
| 704 | + | |
703 | 705 | | |
704 | 706 | | |
705 | | - | |
| 707 | + | |
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
| |||
2519 | 2521 | | |
2520 | 2522 | | |
2521 | 2523 | | |
2522 | | - | |
2523 | | - | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
2524 | 2527 | | |
2525 | 2528 | | |
2526 | 2529 | | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
2527 | 2536 | | |
2528 | 2537 | | |
2529 | 2538 | | |
| |||
2556 | 2565 | | |
2557 | 2566 | | |
2558 | 2567 | | |
| 2568 | + | |
2559 | 2569 | | |
| 2570 | + | |
2560 | 2571 | | |
2561 | 2572 | | |
2562 | 2573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1931 | 1931 | | |
1932 | 1932 | | |
1933 | 1933 | | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
1934 | 1984 | | |
1935 | 1985 | | |
1936 | 1986 | | |
| |||
2243 | 2293 | | |
2244 | 2294 | | |
2245 | 2295 | | |
| 2296 | + | |
| 2297 | + | |
2246 | 2298 | | |
2247 | 2299 | | |
2248 | 2300 | | |
| |||
0 commit comments