Bug 589821
Summary: | Disable caching of program locations in the hash table? | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Matt McCutchen <matt> |
Component: | bash | Assignee: | Roman Rakus <rrakus> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 12 | CC: | rrakus, tsmetana |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-05-19 19:40:35 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Matt McCutchen
2010-05-07 01:49:44 UTC
Try to enable shopt checkhash. From the man page: If this is set, Bash checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed. Please consider the merits of my original proposal. "checkhash" only addresses the failure to run a removed program, not the failure to find a newly installed program. When I looked in the man page, I noticed another option "hashall" that can be turned off to disable the caching completely. I did a new timing test using "hashall", with results similar to the previous test: $ time (enable -n true; for i in {1..10000}; do true; done) real 0m14.399s user 0m3.148s sys 0m12.817s $ time (enable -n true; set +o hashall; for i in {1..10000}; do true; done) real 0m16.709s user 0m3.706s sys 0m14.814s $ time (enable -n true; for i in {1..10000}; do true; done) real 0m15.623s user 0m3.436s sys 0m13.965s $ time (enable -n true; set +o hashall; for i in {1..10000}; do true; done) real 0m16.891s user 0m4.119s sys 0m14.719s Unfortunately, there's no way to disable "hashall" system-wide without patching bash. The SHELLOPTS environment variable can only turn options on, not off (pretty poor design). There can be some non-so-fast hw. For example CD, NFS mount... I'm not willing to change current behaviour (and upstream will not be either). |