-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Performance of _bash-preexec_'s DEBUG trap #1943
Comments
Hmm, this seems like an issue that affects bash-preexec globally, not just a problem in Bash-it. We should probably migrate this problem to the bash-preexec repo instead. |
Yes, I'll alsö be submitting an issue upstream! There have been numerous complaints of minor performance issues with Bash It and this may be related, so we should at least track it if not do something in Bash It to ameliorate the impact. Of course, besides contrived examples it may not really impact interactive performance anyway. I need to test more. |
Expected Behavior
I expect a DEBUG trap to have some minor performance impact that largely doesn't matter for an interactive shell.
Current Behavior
Using the below contrived example, which started as troubleshooting a parameter substitution performance issue:
:
(no-op) trap__bp_preexec_invoke_exec
function!Honestly, doubling performance cost of every simple command would be acceptable and I wouldn't notice. But, it seems that having any DEBUG trap in Bash causes a simple
echo
to triple in cost. A nontrivial function for the trap? bananas.Possible Solution
$preexec_functions
has contents?Context
I was debugging a string handling performance issue and accidentally tested the DEBUG trap and...wow...
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: