From: Roman Volosatovs Date: Mon, 8 Nov 2021 10:53:59 +0000 (+0100) Subject: zshrc: add `NOETCHOSTS` parameter X-Git-Tag: v0.19.1~4^2 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=f444c52ee3ccb55bb312a074d38484a1b42c26c9;hp=f444c52ee3ccb55bb312a074d38484a1b42c26c9;p=grml-etc-core.git zshrc: add `NOETCHOSTS` parameter `/etc/hosts` may be used as a denylist for undesired hosts on some systems. In such usage scenarios the file may be large in size and parsing it may severely impact shell startup time. For example, on a system with `/etc/hosts` from https://github.com/StevenBlack/hosts: ``` % cat profile.zsh #!/usr/bin/env zsh zmodload zsh/zprof source ./etc/zsh/zshrc zprof ``` ``` % ./profile.zsh | head -3 num calls time self name ----------------------------------------------------------------------------------- 1) 1 1181.93 1181.93 87.91% 1181.14 1181.14 87.85% grmlcomp ``` ``` % NOETCHOSTS=1 ./profile.zsh | head -3 num calls time self name ----------------------------------------------------------------------------------- 1) 2 79.77 39.88 47.37% 79.77 39.88 47.37% compaudit ``` Signed-off-by: Roman Volosatovs ---