Repository navigation
Conversation
|
GNU testsuite comparison: |
|
please provide hyperfine output, merci! |
|
however this one does not seem worth it. main wins. |
|
|
GNU testsuite comparison: |
|
as we don't have benchmarks, here is one: #10927 |
dce735f to
9f1afa3
Compare
|
GNU testsuite comparison: |
|
It does not appear to have detected a performance difference with the benchmarks, can you confirm if the benchmarks applied to the use case here? |
|
The difference is pretty small locally after several runs more or less what seen here. |
|
hi, this one can't be merged as it is:
|
9f1afa3 to
aa3f048
Compare
|
sorry for late reply, the gain shows with a negative offset ... seq 1 2000000 > in.txt offset main gh10925 |
|
let's see if codspeed says anything here :) |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
This PR updates InputSplitter’s internal FIFO buffer to use VecDeque instead of Vec, avoiding O(n) shifts when removing from the front.
Changes:
- Replace
VecwithVecDequefor the internal buffer. - Switch front operations from
insert(0)/remove(0)topush_front/pop_front. - Use
push_backfor enqueueing new items in FIFO order.
| File | Description |
|---|---|
src/uu/csplit/src/csplit.rs |
Migrates InputSplitter buffering to VecDeque to make front removals O(1). |
Review effort: Lite
| self.buffer.push_back((ln, Ok(line))); | ||
| self.buffer | ||
| .pop_front() | ||
| .map(|(_, head_line)| head_line.unwrap()) |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
Review effort: Lite
|
Binary size comparison: |
|
thanks for the work on this! |
Replace Vec with VecDeque in InputSplitter to avoid O(n) shifts on remove(0). Use push_front/pop_front/push_back for O(1) queue operations.
99a5698 to
6aa1dcd
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
1 resolved since last review
Review effort: Lite
| // only `Ok` lines are ever stored in the buffer | ||
| let head_line = if let Some((_, Ok(head_line))) = self.buffer.pop_front() { | ||
| Some(head_line) | ||
| } else { | ||
| None | ||
| }; | ||
| self.buffer.push_back((ln, Ok(line))); | ||
| head_line |


Replace Vec with VecDeque in InputSplitter to avoid O(n) shifts on remove(0). Use push_front/pop_front/push_back for O(1) queue operations.