> The theoretical answer depends on lots of things, such as: > > 1) the probable number of times that the method will be called, > 2) the likelihood that the lookup (if implemented) will succeed, > 3) the cost of creating the object, > 4) the cost of the name lookup is, > 5) the incremental GC cost if duplicate copies of the object become > garbage, > 6) the incremental GC cost if the mapping data structure keeps > otherwise garbage objects alive, > 7) the incremental GC cost if the application keeps duplicate > copies of the objects alive, > 8) the (speculative) cost of using obj.equals(obj2) versus obj == obj2 > if we could guarantee that objects are ONLY created via the method, > 9) etcetera > > > And all of these depend on the nature of the objects and the way that they > are used in a typical application. In short, there are no general answers.
Hi Steve, I know that this depends on a lot of things but I just wanted to know if this has been discussed before and if there is any "guide" for the most likely cases. I prefer a style of very clean "semantics" which means that I will implement the lookup in most cases, even if there my be some performance issues - if they're not too big. ---- Jan
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
_______________________________________________ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath