Ongoing: Caching of setup-environment-commands
for faster initialisation
#290
Labels
ongoing
Ongoing efforts of incremental improvements
Milestone
You can place this at the start of your
config/environment.bash
User Configuration file to enable caching:https://gist.github.com/balupton/4d1af347074e676ff9e5eb96c1cbaf3d#file-environment-bash
Feel free to share your modifications and enhancements below.
Thanks to @joelmccracken for the suggestion, and @molleweide for the brainstorming and initial experimentation.
User configuration is the correct location for this, as caching always incurs risks, especially for something as important and foundational as
setup-environment-commands
and its role in the shell's init process. As such, having it inside the user configuration allows the user to adapt the behaviour to their own risk management, while also doing the importance of two of Dorothy's principles: convergence to find supremacy, and daily driving to find reliability.Edge cases and other considerations:
sources/environment.*
to reload environment variables after say a system modification (such as aftersetup-util-devel
), caching would need to play well with that. Possible improvement here is limiting this to login shell execution, or something like that.flock
or some other semlock functionality could be used to avoid this. The latest version solves this.sources/environment.*
after a delay or as an alias invocation. The latest version solves this.__mkdirp
call, and perhaps$DOROTHY/state
is a better location. The latest version solves this.The text was updated successfully, but these errors were encountered: