[erlang-questions] potential compiler improvement?

James Hague james.hague@REDACTED
Tue Oct 27 17:58:43 CET 2009


> I suspect unpacking 7 or 5 arguments takes more or less the same time.

First off, good discussion!

In C--and HiPE--perhaps the times are the same, but I was thinking
about threaded BEAM code where unpacking the additional three values
involves three more BEAM instructions (assuming those aren't collapsed
into one super-instruction at load time).

Also, in lots of functions a significant portion of the instructions
are moves from temporary registers to parameter registers. (Typically
there's a string of these right before a function call, one per
parameter.) So it is *possible* that delaying the loads of tuple
elements until right before needed may reduce the amount of register
shuffling going on.  Maybe.  I completely agree with Joe that this is
tricky stuff!

James


More information about the erlang-questions mailing list