[erlang-questions] Why is erlc so quick to start?
Mon Jan 5 11:33:21 CET 2015
On 01/05/2015 11:05 AM, Roger Lipscombe wrote:
> On 5 January 2015 at 09:14, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
>> Maybe you can compare "erlc myfile" with "erl -s compile file myfile"? Or
>> start some other code that does something relevant, with and without the
>> magic arguments.
> Given foo.erl:
> compile() ->
> "erlc foo.erl" takes 0.18 secs.
> "erl -noinput -s foo compile" takes 0.23 secs.
> "erl +sbtu +A0 -noinput -mode minimal -boot start_clean -s foo
> compile" takes 0.17 secs.
> "+sbtu" doesn't seem to make any difference; "+A0" seems to
> responsible for ~0.04 secs; "-mode minimal" for ~0.03 secs; "-boot
> start_clean", again, seems to make no difference.
We discussed it a bit on IRC after my post here and came to the same
conclusions. The biggest gain from "erl" to "erlc" comes from -noinput.
After that, the small gains you mention are what do the rest.
We then went on to guess that what makes some escripts slow would be
either what "escript" is doing (the compile/interpreting/dealing with
packaged escripts; this won't show up in a 2 lines escript :-) or what
the escript itself is doing. None of us being really interested in
escripts the discussion ended there.
"erlc" could most likely be much faster because it currently uses the
start_clean boot file. It would be interesting to experiment with a
minimal boot file.
I like the current findings though, I can use them in other areas (edoc,
triq, erlydtl, ...).
More information about the erlang-questions