Why rc.d? #4
-
Explicit sourcing of scripts best for me in reasons:
Ofc, add another file into rc.d directory will be faster. But I think, that any multiple additions will decrease performance. So, why rc.d? =) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The overhead of sourcing a file is negligible in As for your question "Why
|
Beta Was this translation helpful? Give feedback.
-
Here I mean performance degrade with tons of code inside, not globbing itself. So, direct sourcing here will be better in terms of explicity. This is my philosophy. =) |
Beta Was this translation helpful? Give feedback.
The overhead of sourcing a file is negligible in
zsh
. On my machine, there's a delay of only 0.000012 to 0.000025 seconds between the evaluation of thesource
or.
statement and the evaluation of the first statement in the sourced file. The total overhead of all.
calls in the.zshrc
file here combined is only 0.000133 seconds and the evaluation of$ZDOTDIR/rc.d/<->-*.zsh(n)
takes just 0.000037 seconds. I think we can live with that. 🙂As for your question "Why
rc.d
?", I have two answers:git
is better at detecting file renames than at keeping track of blocks of code being moved inside the same file, especially if you've made other modifications, too.