Conversation
bee-san
marked this pull request as draft
October 1, 2026 18:21
bee-san
force-pushed
the
perf/lazy-dns-resolver
branch
from
October 2, 2026 09:36
5c88b77 to
b0dedb6
Compare
bee-san
force-pushed
the
perf/scan-error-handling
branch
from
October 2, 2026 09:44
22fe44c to
5ceb728
Compare
This branch has not been deployed
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.
Closed and timed-out TCP probes format several discarded strings even with debug logging disabled. This change retains the original I/O error and only adds target context for enabled diagnostics. Descriptor exhaustion uses Unix/Winsock error codes instead of formatting and lowercasing OS messages.
Performance status
Draft: the strict no-slowdown condition is still not established across platforms. This version is based directly on merged Tokio master
b7119f7f3eb1601e81126ef3572699ed7b3b7c0b. UDP probe, socket and timeout code is unchanged. It no longer depends on #949 or the closed Tokio alternatives.The previous version on the alternative runtime saved 6–8% on closed-port TCP, but slowed UDP echo by 3.5–4%. That is why this remains a draft. The CI comparison now includes open-only TCP and UDP scenarios using the existing listeners, with extra repeated samples for the short UDP case. A passing broad CI threshold alone will not establish a universal speedup.
Implementation
EMFILE/ENFILEon Unix andWSAEMFILEon Windows; preserve the fatal-error message.Simplification: the original draft’s UDP changes and runtime migration are removed; the diagnostic helper owns only error context and collection.
Validation so far
cargo test --locked scanner::errors: all 6 network-free tests passed. Disabled/full diagnostics never format discarded errors; enabled diagnostics retain details, deduplicate, and detect descriptor exhaustion by OS code.cargo fmt --checkandgit diff --check: passed.cargo test --locked: 79 passed, zero failed; one pre-existing ignored doctest.cargo clippy --locked --all-targets -- --deny warnings: passed.cargo doc --locked --workspace --all-features --no-deps --document-private-items: passed.5ceb72882f2584763904fbf04f7652bf2a96fa57.Previous benchmark evidence remains available for comparison; it is not evidence for the current Tokio implementation.
Current Tokio benchmark results
Scan-timer medians against
b7119f7in the same runner, release/LTO. Negative means less time:The Linux TCP gain is consistent across batch sizes. The earlier 3.5–4% UDP slowdown did not recur in this 32-responder workload, but it is a different fixture from the earlier 256-responder workload. Windows differences are small. macOS varied widely: default TCP baseline samples ranged from 0.853 to 3.927 s and candidate samples from 0.945 to 1.853 s. Its paired uncertainty spans both improvement and slowdown, so these medians do not justify claiming a universal speedup or a clean no-slowdown result. This PR therefore remains a draft; the independently validated startup and port-preparation changes are #949 and #954.