[Back]


Contributions to Proceedings:

M.A. Ertl:
"Methods in objects2: Duck Typing and Performance";
in: "28th EuroForth Conference", EuroForth, 2012, 96 - 103.



English abstract:
The major new feature of objects2 is defining
methods for any class (like in Smalltalk): this
means that we can have two classes that are
unrelated by inheritance, yet react to the same
messages and can be used in the same contexts; this
is also known as duck typing. This paper discusses
the implementation of method dispatch for these
general selectors as well as the more restricted
class selectors of the original objects.fs,
and compares the memory and execution time costs of
these method selector implementations: Unhashed
general selectors are as fast as class selectors
(down to two instructions), but can consume a lot of
memory (megabytes of dispatch tables for large class
hierarchies); hashed general selectors are
significantly slower (>=43 cycles), but consume
less memory. Programmers don't need to choose a
selector implementation up front; instead, it is
easy to switch between them later, on a per-selector
basis.


Electronic version of the publication:
http://publik.tuwien.ac.at/files/PubDat_216138.pdf


Created from the Publication Database of the Vienna University of Technology.