|
RuntimeOverhead
Runtime overhead of programs that use ECT objects.
Featured You can see some research of this question in tdk2008.pdf. Some extract of this: FieldsTime of reading and updating object fields, compared to record fields:
Method callsMethod calls can be compared to several Erlang function call conventions:
Module = io,
Module:format("hello~p", []),overhead: < 20% Function = fun(A, B) -> A+B end, C = Function(1, 2) overhead: < 150% (2.5 times slowdown) io:format("hello~p", [])overhead: < 900% (10 times slowdown) The length of inheritance chain does not affect these numbers. The reason for the results is that method calls are actually built on dynamic function calls. So if you use them where you need late binding of calls - in place of a dynamic, or a FUN call -, the price is not too big. When you do not need this, or performance is an issue, call methods like functions, or even define functions instead of methods. |
► Sign in to add a comment