Этот фрагмент поможет:
[code:ensure_loaded(list_to_atom(filename:rootname(filename:basename(F))))
|| P <- code:get_path(), F <- filelib:wildcard(P ++ "/*.beam")].
Поместите его в файл ~/.erlang
как одну строку (включая точку: .
), и он будет выполнен при запуске любой Erlang shell.Будьте осторожны, это ужасно медленно!
» time erl -noshell -s init stop
erl -noshell -s init stop 0.11s user 0.02s system 11% cpu 1.143 total # Without
» time erl -noshell -s init stop
erl -noshell -s init stop 7.31s user 1.08s system 88% cpu 9.480 total # With