CS 412/413
Introduction to Compilers
Spring 2001

Method Calls

Invokes a method on an object, 2*N times.  Half the calls are on a method of a class, which can be optimized to a function call.  The other half are on a method of an interface.  The method toggles a boolean value.  This tests the efficiency of your compiler's method dispatch and null object checking.

Source: [MethCall.im methcall.cpp MethCall.java]
The final value (false) of the toggle for both the class and interface objects.

C++ 0.5
B 1.3
Java 1.42
C 1.73
D 2.3
E 2.39
F 2.43
H 6.18