-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc bugfixes, asyncio speed optimizations #1051
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #1051 +/- ##
=====================================
- Coverage 92% 92% -0%
=====================================
Files 304 306 +2
Lines 19285 19376 +91
=====================================
+ Hits 17726 17778 +52
- Misses 1559 1598 +39 ☔ View full report in Codecov by Sentry. |
Before we merge this we need to make sure to test with httpx/gowitness as @aconite33 reported they weren't working well on this branch. |
cb73560
to
e02c686
Compare
Confirmed gowitness does seem to be running into some problems. |
39a3a92
to
ae25d8a
Compare
The purpose of this branch was to experiment with some asyncio-related speed optimizations in response to this issue.
The changes are designed to adapt BBOT to asyncio's idiosyncrasies by cutting down on usage of
asyncio.create_task()
. This reduces DNS parallelism, but speeds up performance considerably in the long run, since it frees the event loop to do other things.Also included in this PR is the deletion of our custom
CacheDict
class, which was used for DNS caching and was taking up an unnecessary amount of CPU during large scans. In its place we are now usingcachetools
, an off-the-shelf library that's stable and much better-behaved.Benchmark
Command:
Before:
24+ hours
After:
55 minutes, 29 seconds
To help with DNS/HTTP debugging,
log.trace()
is now used instead oflog.debug()
. This lets us enable DNS/HTTP debugging independently without also needing to enable--debug
.