Optimizing Erlang
Eranga Udesh
casper2000a@REDACTED
Fri Mar 3 15:17:56 CET 2006
Hi,
I have a couple of questions regarding Erlang CPU/memory Optimization.
1. Due to the single assignment restriction in Erlang, when changing
values in a record as below.
Eg: NewRecord = OldRecord#record_type{attribute = Value}.
does Erlang take a full copy of the record to change only the
attribute called "attribute"? If so, isn't that a waste of full memory
copying to just change one attribute and if the old copy is never used?
2. In gen_server handle_call/handle_cast/etc, does the State parameter
makes a new copy in each call/cast/etc? Or changes the same State?
3. When passing large lists/binary/etc to a function, are they going as
references or values (a full copy of data)?
4. Is there any overhead difference between writing functions in the
form of, fun(A, B, C) or fun([A,B,C]) or fun({A,B,B})?
5. Is there any overhead difference between if and case expressions?
6. Is it Ober or jInterface better to write Java based GUIs for Erlang
Backends? Any other better language for this? GS doesn't have much support
in designing good interfaces.
7. In a high capacity system, is it better to run the Mnesia DB in the
same Erlang instance (no data transfer between processes) or have it as a
RDBMS in a separate Erlang instance, so that in a multi-CPU environment can
gives a higher capacity?
8. Does Mnesia bag type database does an exhaustive search when called
mnesia_match_object/3?
Thanks,
- Eranga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060303/95247b4c/attachment.htm>
More information about the erlang-questions
mailing list