Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

環境変数定義で`brew --prefix`使ってると遅かったと言うくだらない話

Posted at

事の発端はZshの起動が遅いから早くしたかった

起動は約4秒
遅すぎた

とりあえずよくある改善を試した

oh-my-zshを使っていたので、辞めてpreztoに変えた。
ここら辺はたくさん記事あるので特に書きません。

この変更で4秒から1.2秒くらいまで一気に早くなった

1.2秒でも地味に遅い

計測した結果○○env系が遅かったのでこちらの記事を参考に遅延ロードするようにした。

ここまでで0.8秒くらいまで早くなった。

0.8秒でもまだ遅い気がする

原因が分からなかったが、zshrcに記述している何かが悪いことまではわかっていた。

結論

環境変数定義のために何箇所が記述しているbrew --prefixが遅かった。

厳密に言うとbrew --prefixだけならそこまででもないが、brew --prefix pythonなど何かを指定している部分がかなり遅かった。

とりあえずbrew --prefix系を全部書き換えたら早くなりました、と言うくだらない話でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?