Source: Audit findings (LOW perf, grouped)
A handful of small wins, none individually urgent. Easy to do together once someone is in the file.
-
ZRANGEBYSCORE filters twice (`src/storage/types.rs:256-264`): `range_by_score_bounded` does a `take_while` + `filter` chain over the collected range. Fold both predicates into one closure before `.collect()`.
-
Command name uppercased multiple times (`src/server/connection.rs:202,298`): inline command parser already normalizes; extract once and pass through.
-
`maxmemory_policy.clone()` per write command (`src/server/connection.rs:552`): the policy String is cloned from `Arc` on every SET/ZADD/etc. Pass as `&str` or switch `maxmemory_policy` from `String` to a small enum.
-
LRU clock incremented on every access (`src/storage/db.rs:67-68,86-87`): `touch_lru` mutates on every get/get_mut/set. Under single-threaded execution this is fine; sample every N accesses or every M μs if a future change ever multi-threads command execution.
-
`to_vec()` on `Bytes` (multiple sites in `src/command/strings.rs:197,332,378,395`): unnecessary copy where the underlying `Bytes` would do. Audit and replace.
Each item is independent and self-reviewable.
Source: Audit findings (LOW perf, grouped)
A handful of small wins, none individually urgent. Easy to do together once someone is in the file.
ZRANGEBYSCORE filters twice (`src/storage/types.rs:256-264`): `range_by_score_bounded` does a `take_while` + `filter` chain over the collected range. Fold both predicates into one closure before `.collect()`.
Command name uppercased multiple times (`src/server/connection.rs:202,298`): inline command parser already normalizes; extract once and pass through.
`maxmemory_policy.clone()` per write command (`src/server/connection.rs:552`): the policy String is cloned from `Arc` on every SET/ZADD/etc. Pass as `&str` or switch `maxmemory_policy` from `String` to a small enum.
LRU clock incremented on every access (`src/storage/db.rs:67-68,86-87`): `touch_lru` mutates on every get/get_mut/set. Under single-threaded execution this is fine; sample every N accesses or every M μs if a future change ever multi-threads command execution.
`to_vec()` on `Bytes` (multiple sites in `src/command/strings.rs:197,332,378,395`): unnecessary copy where the underlying `Bytes` would do. Audit and replace.
Each item is independent and self-reviewable.