Commit 7ecb672
perf(core): coalesce per-write relation resolution into one offline pass
Scheduling a whole-project resolve_project_relations on every write (#1015)
made the accept path heavier and piled up under concurrency. A write-load
benchmark showed this branch ~30-70% slower per accept than main on local
SQLite, with the per-write full-project relation scan as the dominant cost.
Coalesce instead: the first write of a burst schedules one debounced background
pass and every other write for that project coalesces onto it (at most one
pending pass per project, tracked in process-global state). The accept path
only enqueues; reconciliation runs offline. Test mode early-returns before
marking pending so the coalescing set cannot leak.
Refs benchmarks/docs/write-load-benchmark.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>1 parent cf81acd commit 7ecb672
2 files changed
Lines changed: 68 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
950 | 958 | | |
951 | 959 | | |
952 | | - | |
| 960 | + | |
953 | 961 | | |
954 | 962 | | |
955 | 963 | | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
961 | 970 | | |
962 | 971 | | |
963 | 972 | | |
964 | 973 | | |
| 974 | + | |
965 | 975 | | |
966 | 976 | | |
967 | | - | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
968 | 987 | | |
969 | | - | |
| 988 | + | |
970 | 989 | | |
971 | 990 | | |
972 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
973 | 1000 | | |
974 | 1001 | | |
975 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
113 | 140 | | |
114 | 141 | | |
115 | 142 | | |
116 | 143 | | |
117 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
| |||
125 | 155 | | |
126 | 156 | | |
127 | 157 | | |
| 158 | + | |
| 159 | + | |
0 commit comments