Commit 4dd0ad7
committed
Auto merge of #17478 - kilpkonn:master, r=Veykril
Simplify some term search tactics
Working on the paper `@phijor` found that "Data constructor" tactic could be simplified quite a bit by running it only in the backwards direction. With n+1 rounds it has same coverage as previous implementation in n rounds, however the tactic it self is more simple and also potentially faster as there is less to do.
In a nutshell the idea is to only work with types in the wish-list rather than with any types.
Turns out it is quite a bit faster:
Before:
```
ripgrep:
Tail Expr syntactic hits: 238/1692 (14%)
Tail Exprs found: 1223/1692 (72%)
Term search avg time: 15ms
nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2143/3001 (71%)
Term search avg time: 849ms
```
After
````
ripgrep:
Tail Expr syntactic hits: 246/1692 (14%)
Tail Exprs found: 1209/1692 (71%)
Term search avg time: 8ms
nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2028/3001 (67%)
Term search avg time: 305ms
````
_Also removed niche optimization of removing scope defs from the search space as this wasn't helping much anyway and made code a bit more complex._File tree
8 files changed
+163
-456
lines changed- src/tools/rust-analyzer
- crates
- hir/src
- term_search
- ide-assists/src/handlers
- ide-completion/src
- ide-diagnostics/src/handlers
- rust-analyzer/src
- docs/user
- editors/code
8 files changed
+163
-456
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 96 | | |
103 | 97 | | |
104 | 98 | | |
| |||
212 | 206 | | |
213 | 207 | | |
214 | 208 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 209 | | |
247 | 210 | | |
248 | 211 | | |
| |||
275 | 238 | | |
276 | 239 | | |
277 | 240 | | |
278 | | - | |
| 241 | + | |
279 | 242 | | |
280 | 243 | | |
281 | 244 | | |
| |||
328 | 291 | | |
329 | 292 | | |
330 | 293 | | |
331 | | - | |
332 | | - | |
333 | 294 | | |
334 | 295 | | |
335 | 296 | | |
336 | 297 | | |
337 | 298 | | |
338 | 299 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | 300 | | |
345 | 301 | | |
346 | 302 | | |
| |||
0 commit comments