Skip to content
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

fix: do not invoke debug traps during completion funcs #163

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Sep 17, 2024

Not the best implementation, but this seems to match what bash does and can speed up completion when using debug traps (such as the one that starship installs).

Copy link

Test Results

410 tests   396 ✅  21s ⏱️
 68 suites   14 💤
 11 files      0 ❌

Results for commit 1587bd5.

Copy link

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.60 μs 3.60 μs -0.00 μs ⚪ Unchanged
instantiate_shell 60.16 μs 60.38 μs 0.22 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 27943.91 μs 27389.76 μs -554.14 μs 🟢 -1.98%
parse_bash_completion 5541.92 μs 5577.60 μs 35.68 μs 🟠 +0.64%
parse_sample_script 8.79 μs 8.86 μs 0.07 μs 🟠 +0.83%
run_echo_builtin_command 94.73 μs 93.01 μs -1.72 μs 🟢 -1.82%
run_one_builtin_command 114.24 μs 111.85 μs -2.39 μs 🟢 -2.09%
run_one_external_command 1939.63 μs 1945.86 μs 6.23 μs ⚪ Unchanged
run_one_external_command_directly 999.22 μs 993.70 μs -5.52 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/completion.rs 🔴 42.92% 🔴 42.64% 🔴 -0.28%
brush-core/src/shell.rs 🟢 78.21% 🟢 77.59% 🔴 -0.62%
brush-shell/src/main.rs 🟢 89.6% 🟢 88.8% 🔴 -0.8%
Overall Coverage 🟢 76.27% 🟢 76.21% 🔴 -0.06%

Minimum allowed coverage is 70%, this run produced 76.21%

@reubeno reubeno merged commit 9a03628 into main Sep 17, 2024
10 checks passed
@reubeno reubeno deleted the no-debug-traps-during-completion branch September 17, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant