感謝の日記

ゾンビが日々の感謝を綴ります

感謝の日記 2023年5月6日

cdrについて解説記事の著者様に感謝します

ターミナルでの作業が捗ります。

ziと遅延読み込みの解説記事著者様に感謝します

高速化に成功しました!

解説記事ではzinit使用でしたが、すでに導入済みだったziを使いました。ziでも同じような構文で使えました。

$ZDOTDIR/.zshrc の例

zi wait lucid light-mode as'null' \
    atinit'[ -f $ZDOTDIR/settings.zsh ] && . $ZDOTDIR/settings.zsh' \
    atinit'[ -f $ZDOTDIR/aliases.sh ] && . $ZDOTDIR/aliases.sh' \
    atinit'[ -f $ZDOTDIR/keybinds.zsh ] && . "$ZDOTDIR/keybinds.zsh"' \
    atinit'[ -f $ZDOTDIR/fzf.zsh ] && . $ZDOTDIR/fzf.zsh' \
    atinit'[ -f $ZDOTDIR/nnn.sh ] && . $ZDOTDIR/nnn.sh' \
    for 'z-shell/null'

もともと大した設定してなかったのでアレですが、たしかに効果はあります。

遅延読み込み無しの場合(初回だけやたら時間かかってるのが謎)

$ for i in {1..5}; do time zsh -ic exit; done
zsh -ic exit  0.19s user 0.15s system 86% cpu 0.382 total
zsh -ic exit  0.03s user 0.02s system 104% cpu 0.044 total
zsh -ic exit  0.03s user 0.02s system 104% cpu 0.046 total
zsh -ic exit  0.04s user 0.03s system 103% cpu 0.063 total
zsh -ic exit  0.04s user 0.03s system 103% cpu 0.067 total

遅延読み込みした場合

$ for i in {1..5}; do time zsh -ic exit; done
zsh -ic exit  0.02s user 0.01s system 108% cpu 0.031 total
zsh -ic exit  0.01s user 0.01s system 108% cpu 0.019 total
zsh -ic exit  0.01s user 0.01s system 108% cpu 0.021 total
zsh -ic exit  0.02s user 0.01s system 106% cpu 0.034 total
zsh -ic exit  0.01s user 0.01s system 108% cpu 0.020 total

Arch Linux 開発チーム様、いつもありがとうございます

今回も無事アップデートできました。