Refactor for clippy and speed#32
Open
gintsgints wants to merge 15 commits into
Open
Conversation
In the steady state (heap at capacity), every faster query freed the evicted entry's Vec and allocated a fresh one via record.to_vec(). Reuse the popped buffer (clear + extend_from_slice) so eviction allocates only when the new record exceeds the recycled capacity. On `slow top` over a large pgbench log this halves total allocation blocks (1,483 -> 726) with no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Inline the variable into the format! string in tests/errors.rs and tick the task off in REFACTOR.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove `-> Result<(), Box<dyn std::error::Error>>` and trailing `Ok(())` from the 27 integration tests that never use `?`. Tests that genuinely use the try-operator keep their Result return type. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- cli.rs: extract errors_command() - main.rs: extract handle_errors_command() - output_results: extract compute_ranges(), process_with_context(), process_parallel() Behavior unchanged; ticks the too_many_lines and unnecessary_wraps tasks in REFACTOR.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- duration.rs: parse ns/us via Duration::from_secs_f64, matching the ms/s/min branches (also rounds instead of truncating). - error_histogram.rs: store bucket counts as usize and compute the bar width with integer rounding instead of float casts. Ticks the numeric-cast tasks in REFACTOR.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- filter_contains_ci.rs: take &str in new() (needless_pass_by_value) - output_results.rs: elide lifetime on record_passes (elidable_lifetime_names) cargo clippy --all-targets -- -W clippy::pedantic now reports zero warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.