From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 28 May 93 14:16:55 GMT From: deccrl!news.crl.dec.com!dbased.nuo.dec.com!digits.enet.dec.com!brett@decw rl.dec.com (My name is...) Subject: Smart Recompilation Message-ID: <1993May28.131724.3700@dbased.nuo.dec.com> List-Id: Background ---------- DIGITAL is now shipping the DEC Ada V3.0 for OpenVMS VAX compiler with the new DEC Ada V3.0 Professional Development Option for OpenVMS VAX Systems. The DEC Ada Professional Development Option implements the Smart Recompilation idea first introduced by Tichy et.al. in 1986. [See Transactions on Prog. Lang. and Systems, Vol 8, No 3, July '86 for Walter Tichy's original article]. This DEC Ada option is one of the very few commercially available implementations of Smart Recompilation for any programming language. The DEC Ada Professional Development Option is expected to be available in the future on OpenVMS and DEC OSF/1 AXP Systems. While the DEC Ada V3.0 for OpenVMS VAX compiler is a normal upgrade for existin g DEC Ada customers, the DEC Ada Professional Development Option is a seperately licensed part of the kit containing the Smart Recompilation capability. Customers who wish to take advantage of Smart Recompilation as well as several other performance enhancements for medium-to-large programs must purchase the DEC Ada V3.0 Professional Development Option License. This License provides the Product Authorization Key (PAK) that grants access to these additional features and capabilities from the DEC Ada V3.0 Compiler Kit. No additional software needs to be installed on the machine nor does it require major changes to the development environment. This option was designed to work with the libraries created without it, and vice versa. Smart Recompilation provides similar capabilities to incremental compilation, while doing so within an environment that uses the standard development tools [source code mgmt, editors, linkers, debuggers] for the host system and in a wa y that supports full traditional optimization of the generated machine code. General Capabilities -------------------- After a source file has changed, the compiler must compile it as usual. Howeve r only those units that semantically were actually affected by the changes become obsolete. If they did not reference the changed sections of the replaced units then they stay current and do not need to be recompiled. The compiler recognises and copes with adding declarations removing declarations reordering of declarations modifying initial expressions of variables, constants, etc. changes in comments [falls out of everything else, since this is the 'recompiled without changing anything' case] Exact details are very complex. Demonstration ------------- Consider the following Ada program... package Strings is type Access_String is access String; function To_Access_String(S : String) return Access_String; function "<"(Left,Right : Access_String) return Boolean; end; with Strings, Generic_Balanced_Tree; package Databases is -- type Key is new Strings.Access_String; type Data is record Age : Integer; end record; -- package Database_Trees is new Generic_Balanced_Tree( Key_Type => Strings.Access_String, Value_Type => Databases.Data, "<" => Strings."<"); -- end Databases; with Databases; package My_Database is procedure Insert( Key : Databases.Key; Data : Databases.Data); end; package body My_Database is Database : Databases.Database_Trees.Tree_Type; procedure Insert( Key : Databases.Key; Data : Databases.Data) is begin null; end; end My_Database; with Databases,My_Database; procedure Eg is begin My_Database.Insert( Databases.Key'(Databases.To_Access_String("Bevin")), Databases.Data'(Age => 35)); end Eg; Now, imagine you are asked to enhance the Strings package that all the above depends on, so that it looks like this instead.. package Strings is type Access_String is access String; function "<"(Left,Right : Access_String) return Boolean; function To_Access_String(S : String) return Access_String; function Some_Fast_Ordering(Left,Right : Access_String) return Boolean; end; Recompiling the application, using Smart Recompilation, does the following [which I have cleaned up a bit to make the salient features clearer] $ acs compile eg > These are the units whose source files have changed %I, The following syntax-checked units are obsolete: STRINGS package specification 16-APR-1993 10:04:39.58 (00:00:01.64) package body 16-APR-1993 10:04:38.78 (00:00:01.96) > These are the units dependent on the above, directly or indirectly. %I, The following units may also be recompiled: > ******** DATABASES package specification 16-APR-1993 09:53:12.01 (00:00:04.93) MY_DATABASE package specification 16-APR-1993 09:55:54.19 (00:00:02.25) package body 16-APR-1993 09:54:25.89 (00:00:05.18) EG procedure body 16-APR-1993 09:57:00.40 (00:00:02.58) > This estimates the compilation times 2 obsolete units, 4 possibly obsolete (total 6) Total elapsed time for last compilation of all 6 units was 0:00:27.31 %I, Invoking the DEC Ada compiler > This must be done because STRINGS_.ADA has changed ADA MY_DISK:[BRETT.TMP]STRINGS_.ADA /ACS=(RE,1,0,STRINGS,S) > This must be done because the derivable subprograms of type Key have changed ADA MY_DISK:[BRETT.TMP]DATABASES_.ADA/ACS=(RE,1,0,DATABASES,S) > This must be done because STRINGS.ADA has changed ADA MY_DISK:[BRETT.TMP]STRINGS.ADA /ACS=(RE,1,0,STRINGS,B) > But the other units were not really affected by the change, and thus > did not need to be recompiled. 3 units compiled in 00:00:15, 3 units did not need to be recompiled Estimated elapsed time savings due to Smart Recompilation was 0:00:10.01 (3 6%) How? ---- I have submitted a paper for TriAda'93 that details more of the DEC Ada Smart Recompilation capabilities and describes how it is implemented and how to benefit from it. More Information ---------------- The Developing Ada Programs manual that ships with the DEC Ada compiler product contains more information about the DEC Ada Professional Development Option and it's Smart Recompilation capability. Bevin R. Brett Consulting Engineer DEC Ada Team Digital Equipment Corporation