You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dispatcher queue does quadratic copying; multi-million-line wordlists spend minutes in bookkeeping #49
Large wordlists (SecLists/Assetnote merges, 1M-10M lines) are the normal input for serious brute-forcing. The dispatcher's queue compaction makes scan overhead grow quadratically with wordlist size, independent of network speed.
Once head >= 1024, this reallocates and copies the entire remaining queue every 1024 dispatches, which is about N²/2048 job copies in total.
Simulate mode, HitRate 0, 50 workers:
entries
time
100k
0.37s
500k
1.86s
1M
5.8s
2M
19.6s
A CPU profile at 2M shows the dispatcher at about 27% cumulative CPU, with most of the remaining time in GC, memmove and memclr; actual job processing is about 0.4s.
Related memory cost: every entry+"."+domain string is built up front, and visited holds another entry for each one, on top of cfg.Entries.
Suggested approach
Compact only when head >= len(queue)/2, or replace the queue with a ring buffer or chunked deque.
Serve depth-1 jobs lazily by index into cfg.Entries instead of materialising them; only queue recursive children.
Add BenchmarkRun1M in simulate mode to guard against regressions.
Done when
Dispatcher overhead is linear: 2M entries in simulate mode takes about 2x the 1M time, and a benchmark is in CI or the Makefile.
Activity
fix: skip overlong wordlist lines instead of failing the run
test: shared scriptable DNS server (internal/dnstest) and new scenarios