Git Bash:为什么Windows上的Bash启动了一个新实例以运行外部命令?
如果您使用procmon启动git-bash并监视bash.exe,您会看到,只需运行一个像clear这样的简单命令启动bash.exe
的新实例。此实例不会在外部命令的使用寿命中持续存在 - 它是启动的,几乎立即终止。因此,如果您键入GREP Hello
您会看到,尽管GREP
进程仍在运行附加bash.exe
Process终止。
BASH是否有一个原因启动新的bash.exe
流程,并且有什么方法可以改变此行为?它导致某些环境中的性能问题是Antivirus软件正在检查启动的每个过程:另一个过程是另一个半秒延迟。
If you start git-bash and monitor bash.exe with procmon, you will see that just running a simple command like clear starts a new instance of bash.exe
. This instance doesn't stick around for the lifetime of the external command - it is started and almost immediately terminates. Thus if you type grep hello
you will see that although the grep
process is still running the additional bash.exe
process terminates.
Is there a reason bash launches a new bash.exe
process and is there any way to change this behaviour? It causes performance problems in certain environments were antivirus software is checking every process that starts: one more process is another half-second delay.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论