Repository navigation
Commit 5b641ae
committed
perf(go): order the body-node owner candidates once, not per lookup
split_body_node_id sorted every callable id on every call, and
_body_source_of calls it once per get_source of a body-node id -- so a bulk
get_source over a page's endpoints sorted 5,955 ids per endpoint on
nats-server. The order is a property of the application, not of the node being
looked up.
longest_first() now produces it and the backend caches it in
_owner_ids_longest_first. Ties break on the id, so the order is total and a
lookup is reproducible rather than dependent on dict iteration.
Found evaluating against the analyzer's real-app corpus.
Refs #4361 parent 805a81b commit 5b641ae
2 files changed
Lines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
375 | 385 | | |
376 | 386 | | |
377 | 387 | | |
| |||
380 | 390 | | |
381 | 391 | | |
382 | 392 | | |
383 | | - | |
384 | | - | |
| 393 | + | |
| 394 | + | |
385 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
386 | 400 | | |
387 | | - | |
| 401 | + | |
388 | 402 | | |
389 | 403 | | |
390 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
55 | 69 | | |
56 | 70 | | |
57 | 71 | | |
| |||
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
75 | | - | |
76 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
77 | 94 | | |
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
83 | | - | |
| 100 | + | |
84 | 101 | | |
85 | 102 | | |
86 | 103 | | |
| |||
0 commit comments