Intern repeated strings in resolved_hosts and dns_children#3006
Merged
TheTechromancer merged 1 commit intoadditional-memory-benchmarksfrom Apr 1, 2026
Merged
Conversation
IP addresses and DNS record type strings (A, AAAA, CNAME, etc.) repeat heavily across events. sys.intern() deduplicates them so all events sharing the same IPs/rdtypes reference the same string object, reducing memory ~10-30% on those fields.
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary+ 2 improvements 🚀
20 unchanged ✅🔍 Significant Changes (>10%)
🐍 Python Version 3.11.15 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## additional-memory-benchmarks #3006 +/- ##
============================================================
- Coverage 91% 91% -0%
============================================================
Files 437 437
Lines 37102 37108 +6
============================================================
+ Hits 33694 33696 +2
- Misses 3408 3412 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TheTechromancer
approved these changes
Apr 1, 2026
b5816e4
into
additional-memory-benchmarks
18 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IP addresses and DNS record type strings (
A,AAAA,CNAME, etc.) repeat heavily across events in a scan. In a typical subdomain enumeration, thousands of events resolve to the same handful of CDN/cloud IPs, and every event carries its own copy of those strings.sys.intern()deduplicates them so all events sharing the same IPs or rdtype keys reference a single string object. This reduces memory ~10-30% on those fields depending on how much IP overlap exists in the scan.Changes
dnsresolve.py— intern rdtype keys and host values indns_childrenandresolved_hostshttpx.py— intern IPs added to_resolved_hostsgowitness.py— intern IPs added to_resolved_hosts