cea-hpc / modules

Environment Modules: provides dynamic modification of a user's environment
http://modules.sourceforge.net/
GNU General Public License v2.0
668 stars 102 forks source link

Visible slowdown when starting sub-shell with Modules 5 #477

Closed xdelaruelle closed 1 year ago

xdelaruelle commented 1 year ago

When the set_shell_startup configuration is enabled and several modules are loaded (>20), it may take some time to start a sub-shell.

This is especially visible when running a shell script that performs a lot a sub-shell execution.

This issue comes from the automatic refresh evaluation that is performed since Modules 5.0 when spawning a sub-shell.

It was observed on a setup with complex modulefiles, taking around 50ms each to evaluate. Refreshing 20 loaded modules took a second to complete.