-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
sort : gnu core utils test (sort-merge-fdlimit.sh) #9849
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
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
src/uu/sort/Cargo.toml
Outdated
| ctrlc = { workspace = true } | ||
| fnv = { workspace = true } | ||
| itertools = { workspace = true } | ||
| libc = { workspace = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use nix here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/uu/sort/src/sort.rs
Outdated
| rng().sample(rand::distr::StandardUniform) | ||
| } | ||
|
|
||
| fn salt_from_random_source(path: &Path) -> UResult<[u8; 16]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add comment to the function and the magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
src/uu/sort/src/sort.rs
Outdated
|
|
||
| let mut count = 0usize; | ||
| for fd in 0..limit { | ||
| if unsafe { libc::fcntl(fd as i32, libc::F_GETFD) } != -1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid the unsafe here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unsafe
|
some jobs are failing and please add tests |
CodSpeed Performance ReportMerging #9849 will improve performance by 16.19%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
GNU testsuite comparison: |
2 similar comments
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
please have a look to the perf regression, 9% is a bit too much |
|
GNU testsuite comparison: |
a7a24fa to
cafb3ca
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Update current_open_fd_count to use unsafe libc::fcntl instead of nix::fcntl, ensuring -1 return for invalid file descriptors, which is more reliable for counting open fds and avoids potential errors. Added GETFD to spell-checker ignore list.
Make the ctrlc dependency and signal handler optional for Redox OS, which lacks signal support. Added cfg attributes to skip signal handling on Redox, preventing compilation errors. Also added clippy allow attributes for FreeBSD in fs.rs.
Exclude redox, fuchsia, haiku, solaris, and illumos from Unix-specific file descriptor soft limit functionality in get_rlimit and fd_soft_limit, returning None on unsupported platforms to avoid compilation or runtime issues.
- Introduce Vec<Range<usize>> token_buffer field to ChunkContents, RecycledChunk, and related impls - Modify parse_lines to reuse and clear token_buffer instead of creating a new vec, improving performance - Update Chunk recycling to include token_buffer in take and init operations - Pass token_buffer mutably to Line::create for token range storage during sorting
- Bumped versions of multiple crates (e.g., aho-corasick 1.1.3→1.1.4, anstream 0.6.19→0.6.21, windows-sys 0.59.0→0.61.2) for bug fixes, security patches, and performance improvements. - Removed libc dependency from a package and renamed wasi to wasip2 as part of upstream changes.
d4c4389 to
1a1eabd
Compare
|
GNU testsuite comparison: |
- Updated jiff from 0.2.17 to 0.2.18 - Updated jiff-static from 0.2.17 to 0.2.18 - Updated libc from 0.2.178 to 0.2.179 - Updated proc-macro2 from 1.0.104 to 1.0.105 - Updated quote from 1.0.42 to 1.0.43 - Updated hashbrown from 0.15.4 to 0.15.5 - Updated syn from 2.0.111 to 2.0.113 - Updated zmij from 1.0.2 to 1.0.12 These updates bring bug fixes, security patches, and performance improvements.
|
GNU testsuite comparison: |
Remove stale package repository SQLite file and force update before installing packages in FreeBSD CI workflows. This prevents installation failures due to outdated package databases, improving reliability in automated builds.
Updated the prepare steps in both FreeBSD CI jobs to write the repository configuration to /usr/local/etc/pkg/repos/FreeBSD.conf before updating and installing packages. This ensures the correct pkg repository is used, preventing potential update failures or outdated package sources.
Add mkdir -p /usr/local/etc/pkg/repos to prepare steps in both jobs to prevent configuration failures if the directory is missing.
|
GNU testsuite comparison: |
Refactor parse_lines to conditionally calculate line_count based on whether selections, num_infos, floats, or numeric mode require reservations, avoiding unnecessary computation when line_count is not used.
Always compute line count and reserve vector capacities, removing the conditional 'needs_line_count' check for cleaner code and consistent behavior.
|
GNU testsuite comparison: |
Add `line_breaks` field to `ChunkContents` and `RecycledChunk` structs to store separator indices. Modify `parse_lines` function to collect all line break positions in a single pass, avoiding redundant iterations over input data. This improves performance by reducing the number of times the input is scanned for separators.
|
GNU testsuite comparison: |
…ry efficiency Replace the `line_breaks` vector, which stored all line separator indices, with a `line_count_hint` usize field. This change estimates the number of lines using the hint (or a default calculation) instead of pre-computing and storing all break positions, reducing memory allocations and improving performance in the sort utility's chunk parsing logic. The hint defaults to a calculated estimate based on buffer size if not provided.
|
GNU testsuite comparison: |
…nd unused features - Compute exact line count for chunks <= 64KB or when hint is 0 to improve accuracy - Skip tokenization and data extraction in Line::create when not required by settings, enhancing performance for simple sorts or small inputs
|
GNU testsuite comparison: |
Modifications were made to pass the GNU coreutils tests.