time /bin/sh -c "echo hi" hi
real 0m0.003s
user 0m0.000s
sys 0m0.003s
time /usr/local/bin/bash -c "echo hi"
hi real 0m0.006s
user 0m0.000s
sys 0m0.006s
time /usr/local/lib/erlang23/bin/erl -eval 'io:format("hi~n"), exit(0)'Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [dtrace]
hi
{"init terminating in do_boot",0}
init terminating in do_boot (0)
Crash dump is being written to: erl_crash.dump...done
real 0m0.304s
user 0m0.117s
sys 0m0.010s
Ok, so 300 ms is clearly too much, but that's running a bunch of stuff.Turning a bunch of stuff off, I get
time /usr/local/lib/erlang23/bin/erl -eval 'io:format("hi~n"), halt(0, [{flush, false}])' -noshell -start_epmd false -boot no_dot_erlang hi
real 0m0.077s
user 0m0.094s
sys 0m0.008s
(I tried tuning down the number of schedulers, but couldn't get the real time lower)This is still a lot worse than bash, but about 75 ms is sort of okish. Maybe a non-stock boot file could help. I usually plan for my BEAMs to run for months or years, so I don't worry too much about startup time :)