Calling internal functions - foo::bar() ?

Kostis Sagonas kostis@REDACTED
Mon Mar 7 17:46:17 CET 2005

"Thomas Lindgren" <thomasl_erlang@REDACTED> wrote:
 > ...
 > Well, the previous optimization only shows there is no
 > real need to forbid :: on grounds of performance.

Nope, that's NOT what your transformation is showing. It only shows
that you can avoid boxing return values in tuples for calls within
the module and still be able to call the function from outside if
you are willing to pay in code size.

It does NOT say anything about other types of transformations/optimizations
that you can do for module-local functions (e.g., removing unreachable
clauses, type tests, profiting from sophisticated static analyses, etc).

It is of course true that for _all_ optimizations you can always keep
the original code around (and pay in code size) so that :: calls are
properly serviced from that code.  But this is really a nuisance, not
to mention the fact that it can really drive you crazy if you are
chasing a bug/behaviour that is present only on the optimized code.

 > Introducing :: may, as you say, still be a bad idea.

Indeed it is.  A very bad one in fact.


More information about the erlang-questions mailing list