Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions src/uu/sort/benches/sort_locale_utf8_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ fn sort_ascii_utf8_locale(bencher: Bencher) {
let output_file = NamedTempFile::new().unwrap();
let output_path = output_file.path().to_str().unwrap().to_string();

let args = ["-o", &output_path, file_path.to_str().unwrap()];
black_box(run_util_function(uumain, &args));
bencher.bench(|| {
black_box(run_util_function(
uumain,
&["-o", &output_path, file_path.to_str().unwrap()],
));
black_box(run_util_function(uumain, &args));
});
}

Expand All @@ -37,11 +36,10 @@ fn sort_mixed_utf8_locale(bencher: Bencher) {
let output_file = NamedTempFile::new().unwrap();
let output_path = output_file.path().to_str().unwrap().to_string();

let args = ["-o", &output_path, file_path.to_str().unwrap()];
black_box(run_util_function(uumain, &args));
bencher.bench(|| {
black_box(run_util_function(
uumain,
&["-o", &output_path, file_path.to_str().unwrap()],
));
black_box(run_util_function(uumain, &args));
});
}

Expand All @@ -54,12 +52,13 @@ fn sort_numeric_utf8_locale(bencher: Bencher) {
data.extend_from_slice(line.as_bytes());
}
let file_path = setup_test_file(&data);
let output_file = NamedTempFile::new().unwrap();
let output_path = output_file.path().to_str().unwrap().to_string();

let args = ["-n", "-o", &output_path, file_path.to_str().unwrap()];
black_box(run_util_function(uumain, &args));
bencher.bench(|| {
black_box(run_util_function(
uumain,
&["-n", file_path.to_str().unwrap()],
));
black_box(run_util_function(uumain, &args));
});
}

Expand All @@ -68,12 +67,13 @@ fn sort_numeric_utf8_locale(bencher: Bencher) {
fn sort_reverse_utf8_locale(bencher: Bencher) {
let data = text_data::generate_mixed_locale_data(50_000);
let file_path = setup_test_file(&data);
let output_file = NamedTempFile::new().unwrap();
let output_path = output_file.path().to_str().unwrap().to_string();

let args = ["-r", "-o", &output_path, file_path.to_str().unwrap()];
black_box(run_util_function(uumain, &args));
bencher.bench(|| {
black_box(run_util_function(
uumain,
&["-r", file_path.to_str().unwrap()],
));
black_box(run_util_function(uumain, &args));
});
}

Expand All @@ -82,12 +82,13 @@ fn sort_reverse_utf8_locale(bencher: Bencher) {
fn sort_unique_utf8_locale(bencher: Bencher) {
let data = text_data::generate_mixed_locale_data(50_000);
let file_path = setup_test_file(&data);
let output_file = NamedTempFile::new().unwrap();
let output_path = output_file.path().to_str().unwrap().to_string();

let args = ["-u", "-o", &output_path, file_path.to_str().unwrap()];
black_box(run_util_function(uumain, &args));
bencher.bench(|| {
black_box(run_util_function(
uumain,
&["-u", file_path.to_str().unwrap()],
));
black_box(run_util_function(uumain, &args));
});
}

Expand Down
16 changes: 16 additions & 0 deletions src/uu/sort/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ sort-error-write-failed = write failed: {$output}
sort-failed-to-delete-temporary-directory = failed to delete temporary directory: {$error}
sort-failed-to-set-up-signal-handler = failed to set up signal handler: {$error}

# Warning messages
sort-warning-failed-to-set-locale = failed to set locale
sort-warning-simple-byte-comparison = text ordering performed using simple byte comparison
sort-warning-key-zero-width = key {$key} has zero width and will be ignored
sort-warning-key-numeric-spans-fields = key {$key} is numeric and spans multiple fields
sort-warning-leading-blanks-significant = leading blanks are significant in key {$key}; consider also specifying 'b'
sort-warning-numbers-use-decimal-point = numbers use '.' as a decimal point in this locale
sort-warning-options-ignored = options '-{$options}' are ignored
sort-warning-option-ignored = option '-{$option}' is ignored
sort-warning-option-reverse-last-resort = option '-r' only applies to last-resort comparison
sort-warning-obsolescent-key = obsolescent key '{$key}' used; consider '-k {$replacement}' instead
sort-warning-separator-grouping = field separator '{$sep}' is treated as a group separator in numbers
sort-warning-separator-decimal = field separator '{$sep}' is treated as a decimal point in numbers
sort-warning-separator-minus = field separator '{$sep}' is treated as a minus sign in numbers
sort-warning-separator-plus = field separator '{$sep}' is treated as a plus sign in numbers

# Help messages
sort-help-help = Print help information.
sort-help-version = Print version information.
Expand Down
Loading
Loading