tma@osc.COM (Tim Atkins) (11/02/90)
As far as method lookup speed advantages possible with strong typing some work I did in Objective C a couple of years ago may be of some interest. I attempted several improvments of the standard algorithm and finally achieved a general lookup in the absence of strong typing on the order of 15 assembler instructions on a Sun 3. Adding type hints (not strong typing but just a hint of the expected type of referenced objects) and using code of the form: implementation = (runtime_type == expected_type) ? precomputed_imp : full_lookup(...); cut the average lookup costs in half for the applications I instrumented. Therefore, it seems to me that not strong typing, but weak type hints are worthwhile for gaining improvements in this area. - Tim Atkins