diff --git a/CHANGES.current b/CHANGES.current index b8a80cfed..78e39dbc1 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release. Version 2.0.8 (in progress) =========================== +2012-08-13: wsfulton + [Java] Patch from David Baum to add the assumeoverride feature for Java directors to + improve performance when all overridden methods can be assumed to be overridden. + 2012-08-05: wsfulton [Python] #3530021 Fix unused variable warning. diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index 8a081f46d..cfee64fa0 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -86,6 +86,7 @@
+When a new instance of a director (or subclass) is created in Java, the C++ side of the director performs a runtime check per director method to determine if that particular method is overridden in Java or if it should invoke the C++ base implementation directly. Although this makes initialization slightly more expensive, it is generally a good overall tradeoff. +
+ ++However, if all director methods are expected to usually be overridden by Java subclasses, then initialization can be made faster by avoiding these checks via the assumeoverride attribute. For example: +
+ +
+%feature("director", assumeoverride=1) Foo;
+
++The disadvantage is that invocation of director methods from C++ when Java doesn't actually override the method will require an additional call up into Java and back to C++. As such, this option is only useful when overrides are extremely common and instantiation is frequent enough that its performance is critical. +
+ +