edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

Improve startup speed by running Python with `-sS` #94

Closed rouge8 closed 3 years ago

rouge8 commented 3 years ago

This patch improves startup speed by disabling Python's site module:

-s     Don't add user site directory to sys.path.

-S     Disable the import of the module site and  the  site-dependent
       manipulations of sys.path that it entails.

Benchmarked with hyperfine, comparing bass installed with fisher to this patch:

hyperfine -S fish 'bass echo hello' 'source functions/bass.fish; bass echo hello' --export-markdown t.md
Command Mean [ms] Min [ms] Max [ms] Relative
bass echo hello 140.2 ± 16.6 125.3 187.5 1.06 ± 0.14
source functions/bass.fish; bass echo hello 131.7 ± 6.2 122.4 142.1 1.00
edc commented 3 years ago

Thanks for the patch! My apology for the slow response.