Repository navigation
Commit 1ea67ba
committed
perf(csharp): cut the member-access pass's overhead; drop the stale changelog hunk (#3528)
Measured on jellyfin/jellyfin (2,208 .cs files, +26.6k access entries on top
of 85.6k member calls, +6,347 `uses` edges), graph output byte-identical
before and after:
- engine.py: the member-access branch asked tree-sitter for `node.parent`
twice per member_access_expression to tell a callee (`db.Users.Where`)
from a property read (`db.Users`); `Node.parent` re-descends from the
root on every call (~700ms over the corpus's 137k such nodes vs ~13ms
for a set lookup). The walk is pre-order, so the invocation branch now
records the callee node's id in a per-file `csharp_callee_ids` set and
the access branch tests membership instead. Per-file extraction goes
from +1.2-1.6s over base to +0.7-0.8s.
- extract.py: `_resolve_type_name_nid` memoizes per (type_name, caller,
file) — a method reads and calls the same receiver many times over, and
every access is one more entry that types it (80k -> 40k scope-chain
walks on the corpus). The `defines` scan that builds property_index is
folded into the existing `method` scan: one pass over all_edges fills
both twin indexes. `_resolve_csharp_member_calls` goes from 430ms to
288ms (base: 250ms).
- CHANGELOG.md: the entry was written under `## 0.9.61 (unreleased)`; after
rebasing onto v8 it lands inside the released 0.9.61 section. Release
notes here are written at the version bump (see 9335cee), so the hunk is
dropped rather than moved.1 parent ab03cb5 commit 1ea67ba
4 files changed
Lines changed: 73 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4734 | 4734 | | |
4735 | 4735 | | |
4736 | 4736 | | |
4737 | | - | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
4738 | 4743 | | |
| 4744 | + | |
4739 | 4745 | | |
4740 | 4746 | | |
4741 | | - | |
| 4747 | + | |
| 4748 | + | |
4742 | 4749 | | |
4743 | 4750 | | |
4744 | 4751 | | |
4745 | 4752 | | |
4746 | 4753 | | |
4747 | | - | |
4748 | | - | |
4749 | | - | |
4750 | | - | |
4751 | | - | |
4752 | | - | |
4753 | | - | |
4754 | | - | |
4755 | | - | |
4756 | | - | |
4757 | | - | |
4758 | | - | |
4759 | | - | |
4760 | | - | |
4761 | | - | |
4762 | | - | |
4763 | | - | |
4764 | | - | |
4765 | | - | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
4766 | 4762 | | |
4767 | 4763 | | |
4768 | 4764 | | |
| |||
4816 | 4812 | | |
4817 | 4813 | | |
4818 | 4814 | | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
| 4819 | + | |
| 4820 | + | |
| 4821 | + | |
4819 | 4822 | | |
4820 | 4823 | | |
4821 | 4824 | | |
| |||
4828 | 4831 | | |
4829 | 4832 | | |
4830 | 4833 | | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
4831 | 4843 | | |
4832 | | - | |
| 4844 | + | |
4833 | 4845 | | |
4834 | 4846 | | |
4835 | | - | |
4836 | | - | |
4837 | | - | |
4838 | | - | |
4839 | | - | |
4840 | | - | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
4841 | 4852 | | |
4842 | 4853 | | |
4843 | 4854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6928 | 6928 | | |
6929 | 6929 | | |
6930 | 6930 | | |
| 6931 | + | |
| 6932 | + | |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
6931 | 6937 | | |
6932 | 6938 | | |
6933 | 6939 | | |
| |||
7394 | 7400 | | |
7395 | 7401 | | |
7396 | 7402 | | |
| 7403 | + | |
| 7404 | + | |
7397 | 7405 | | |
7398 | 7406 | | |
7399 | 7407 | | |
| |||
8046 | 8054 | | |
8047 | 8055 | | |
8048 | 8056 | | |
8049 | | - | |
8050 | | - | |
| 8057 | + | |
| 8058 | + | |
| 8059 | + | |
| 8060 | + | |
8051 | 8061 | | |
8052 | 8062 | | |
8053 | 8063 | | |
8054 | 8064 | | |
8055 | 8065 | | |
8056 | | - | |
| 8066 | + | |
8057 | 8067 | | |
8058 | 8068 | | |
8059 | 8069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
0 commit comments