View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Vinny Ramachandran: Discussion 1

Source Paper:
Reconciling responsiveness with performance in pure object-oriented languages.
http://doi.acm.org/10.1145/233561.233562



The title of this paper implies a discussion of several languages, but the main focus is on SELF (SELF-93, specifically). The author cites significant performance improvements over Smalltalk, and even some advantage over C++. The reason this is mentioned is that in general, object-oriented languages traditionally have significant speed penalties, which offset the gains of extendability, modularity, and general code cleanliness. The reason for this is functionality like late binding (also called dynamic dispatch). Dynamic dispatch allows subclasses to override ancestor methods, and have these methods called even when its instance is identified only by the superclass. In procedural languages (e.g. C) a simple method call like getX(), which returns a structure's field X, could be optimized at compile-time. However, dynamically dispatched calls leave some confusion as to what code will be processed when the method call is made; thus, the decision must be made at runtime, preventing optimization. According to the paper, SELF mitigates this issue by implementing runtime optimization in the form of type feedback. SELF, a pure OOL (unlike, for example, Java), finds subclasses at compile-time which override parent methods. It optimizes very short methods, and places them into a conditional procedure, which types the called instance, and runs the corresponding code. Longer method implementations are not optimized; therefore, at worst the performance is equivalent to unoptimized code.

On the other hand, the author makes note of the complications afforded by interactive programming languages (for example, Smalltalk). This is the bit on 'responsiveness'. He posits that since Smalltalk, et al., favor responsiveness over performance, and since dynamic runtime optimization would directly counteract that philosophy, such languages cannot benefit as easily from these tactics. This points to a fundamental paradigm disparity between Smalltalk and SELF, even within the object-oriented bloc.

In regards to the other question, these differences affect programming in a very subtle manner. Because the very mindset of the language is shifted toward either performance or responsiveness, it creates a code style change almost as dramatic as the difference between procedural and OO styles. When programming in favor of responsiveness, I would expect commonalities to include increased thread use, whereas performance-minded code would be more sparing with multithreaded models. This is one example of coding disparity between the two paradigms, which I believe lends support to the author's arguments.

I read through J. David Shirley's post on the fundamental differences between Java and Smalltalk, and I believe this underscores the point. He referred to Java code as "hackish", which could be used as an example of the performance-mindedness in that descendant of C/C++; C itself would clearly be a candidate for "hackish" code.

Links to this Page