Which is faster?

Shawn Pearce <>
Wed Mar 12 22:30:38 CET 2003

So the "Efficiency Guide" leads me to believe that sticking a function in ets would
be faster than using Module:Function(Arg) to invoke a function.  ie:

	[#rec{function=Fun}] = ets:lookup(some_table, Key),

is faster than:

	[#rec{module=Module, function=Function}] = ets:lookup(some_table, Key),

Clearly either way we are doing an ets call, but I ask in the context of two

	- What is the cost of copying the fun from ets to the local process?

	- What happens when I reload the module that created Fun?  Clearly
	  in the second case hot-reloading works well.


  Just to have it is enough.

More information about the erlang-questions mailing list