Option | Time taken to source zshrc |
---|---|
No Imports | 1152ms |
Import in a single line | 1158ms |
Import in multiple export statements |
1169ms |
# export PATH="$PATH:$HOME/bin:$HOME/bin/tsv-utils:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
# export PATH="$PATH:/usr/local/sbin"
# export PATH="$PATH:/usr/local/bin"
# export PATH="$PATH:/usr/sbin"
# export PATH="$PATH:/usr/bin"
# export PATH="$PATH:/sbin"
# export PATH="$PATH:/bin"
# export PATH="$PATH:/usr/games"
export PATH="$PATH:/usr/local/sbin"
export PATH="$PATH:/usr/local/bin"
export PATH="$PATH:/usr/sbin"
export PATH="$PATH:/usr/bin"
export PATH="$PATH:/sbin"
export PATH="$PATH:/bin"
export PATH="$PATH:/usr/games"
export PATH="$PATH:$HOME/bin:$HOME/bin/tsv-utils:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
$ node -p -e 'new Date() - 0'; source ~/.zshrc; node -p -e 'new Date() - 0';
Open a new tmux pane and just run this command ten times. When done, copy the output of all ten commands to a text file and print the differences as an array using this:
$ cat no_imports_benchmarks.txt | paste - - | gawk '{ print $2-$1 }' | paste -s -d',' -
> without_path_imports = [993,999,1026,1055,1093,1120,1201,1205,1225,1247,1283,1384
... ]
[
993, 999, 1026,
1055, 1093, 1120,
1201, 1205, 1225,
1247, 1283, 1384
]
> _.mean(without_path_imports)
1152.5833333333333
> single_path_import = [1034,1006,1040,1071,1199,1140,1163,1202,1290,1287,1315
... ]
[
1034, 1006, 1040,
1071, 1199, 1140,
1163, 1202, 1290,
1287, 1315
]
> _.mean(single_path_import)
1158.8181818181818
> multiple_path_imports = [985,1014,1040,1079,1119,1133,1227,1205,1252,1282,1342,1357
... ]
[
985, 1014, 1040,
1079, 1119, 1133,
1227, 1205, 1252,
1282, 1342, 1357
]
> _.mean(multiple_path_imports)
1169.5833333333333