From eeca1f3817551325c40e9d7af3fec528e5717a0d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 4 Dec 2023 08:32:49 +0100 Subject: [PATCH] zsh: Remove path deduplication Aside from some more needed things, the path deduplication function is the most time-consuming invocation on zsh startup, taking almost 100ms on my system. Perhaps it would be reasonable to re-introduce when the first invocation from path is occurring but it is simply too much time taken for each time I start a new shell instance for now. --- terminal/.config/zsh/.zshrc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/terminal/.config/zsh/.zshrc b/terminal/.config/zsh/.zshrc index 180def1..35d5659 100644 --- a/terminal/.config/zsh/.zshrc +++ b/terminal/.config/zsh/.zshrc @@ -192,14 +192,6 @@ get_var() { set_var() { eval "$1=\"\$2\"" } -dedup_pathvar() { - pathvar_name="$1" - pathvar_value="$(get_var "$pathvar_name")" - deduped_path="$(perl -e 'print join(":",grep { not $seen{$_}++ } split(/:/, $ARGV[0]))' "$pathvar_value")" - set_var "$pathvar_name" "$deduped_path" -} -dedup_pathvar PATH -dedup_pathvar MANPATH unset CONFDIR unset ZSHCONFDIR