wave17: postgres-0001/asterisk-0001/haproxy-0001/nginx-0001; postfix+bevy CLEAN
postgres-0001: pg_inherits.c typeInheritsFrom() BFS visited List → HTAB O(1) asterisk-0001: app_queue.c interface_exists() ao2_iterator walk → ao2_find O(1) haproxy-0001: http_ana.c cookie-server scan linked-list → eb-tree index O(log S) nginx-0001: ngx_http_link_multi_headers() O(H²) double-scan → O(H) hash pass postfix: CLEAN (htable throughout; two marginal LOW admin-bounded candidates) bevy: CLEAN (FixedBitSet/HashSet throughout; only hardware-bounded marginals)
This commit is contained in:
parent
da8b4a41d6
commit
ff6292d067
10 changed files with 627 additions and 252 deletions
|
|
@ -0,0 +1,24 @@
|
|||
--- a/apps/app_queue.c
|
||||
+++ b/apps/app_queue.c
|
||||
@@ -7686,20 +7686,9 @@ static struct member *interface_exists(struct call_queue *q, const char *interfa
|
||||
{
|
||||
- struct member *mem;
|
||||
- struct ao2_iterator mem_iter;
|
||||
-
|
||||
if (!q) {
|
||||
return NULL;
|
||||
}
|
||||
- mem_iter = ao2_iterator_init(q->members, 0);
|
||||
- while ((mem = ao2_iterator_next(&mem_iter))) {
|
||||
- if (!strcasecmp(interface, mem->interface)) {
|
||||
- ao2_iterator_destroy(&mem_iter);
|
||||
- return mem;
|
||||
- }
|
||||
- ao2_ref(mem, -1);
|
||||
- }
|
||||
- ao2_iterator_destroy(&mem_iter);
|
||||
-
|
||||
- return NULL;
|
||||
+ /* q->members is an ao2 container keyed by interface string; use O(1) hash lookup */
|
||||
+ return ao2_find(q->members, interface, OBJ_KEY); /* was O(M) iterator walk */
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue