native eval
vs znap eval
#137
Answered
by
marlonrichert
midnightexigent
asked this question in
Q&A
-
Are the cases where it is better to use znap eval direnv 'direnv hook zsh'
znap eval ssh-agent 'ssh-agent'
|
Beta Was this translation helpful? Give feedback.
Answered by
marlonrichert
Nov 17, 2021
Replies: 1 comment 2 replies
-
Let's find out, shall we? % typeset -F SECONDS=
% znap eval direnv 'direnv hook zsh'; znap eval ssh-agent 'ssh-agent' # Generate cache
znap eval: generating cache for direnv hook zsh
znap eval: generating cache for ssh-agent
Agent pid 2190
% SECONDS=0; znap eval direnv 'direnv hook zsh'; print $SECONDS
0.0017120000
% SECONDS=0; eval "$( direnv hook zsh )"; print $SECONDS
0.0110550000
% SECONDS=0; znap eval ssh-agent 'ssh-agent'; print $SECONDS
Agent pid 2190
0.0019360000
% SECONDS=0; eval "$( ssh-agent )"; print $SECONDS
Agent pid 3632
0.0069230000
% So, no, there is never a reason to prefer |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
midnightexigent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's find out, shall we?
So, no, there is never a reason to prefer
eval "$( ... )"
overznap eval ' ... '
. Once it has generated the cache,znap eval
is always fa…