performance - Terminal commands running extremely slow
问题描述
I am currently having an issue where certain terminal commands are running extremely slowly.
Some example commands include: kubectl
or brew
Currently time kubectl version
takes 14s and time brew -v
takes around 44s.
I've looked at other threads and they said to check what $PATH is set to, and it seems like mine is set correctly already:
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/hardy/.fzf/bin
I have also tested with set -x
to see exactly what is the delay. When I run kubectl
or brew
with set -x
on, I am able to see that it stalls for an extremely long period of time after the command is run. It stalls for about 40s here:
brew -v
+ brew -v
Both brew
and kubectl
are located in /usr/local/bin
. There are other commands that are located in /usr/local/bin
that are not running extremely slow. Just a select few are running slow I believe.
Do you guys have any idea what the issue is or how to further debug this?
解决方案
推荐阅读
- linux - oneliner 将输出附加到多个变量
- javascript - 运行 react + next.js 项目时遇到问题
- scala - 为什么我在 Scala 中出现 LocalDateTime 错误?
- java - 如何解决 SonarScanner 执行 java.lang.OutOfMemoryError: Java heap space?
- reactjs - 从 UseContext 值初始化 UseState 值
- android - 在颤动中使微调器背景透明
- python - Python - 如何使用 Selenium 在正常模式下打开浏览器而不是私人/访客/隐身模式?
- pine-script - 仅当 Strategy.Openprofit > 0 时 Strategy.Exit
- nest - 使用 Google 的智能设备管理 API 访问 NEST 相机
- php - 使用 PHP 在 PDF 文件中搜索文本