The main reason I had for using the g++ compiler was that the template
instantiation bug in the Sun native compiler was really getting to me. It
meant for me that the time to compile nearly identical pieces of code could
vary from s to
mins, depending on whether the compiler
(for unknown reasons) decided to re-instantiate everything or not. Sun is
aware of this bug and a recent patch has alleviated this problem somewhat.
In g++ the template instantiation is done by hand (with assistance from the aips++ system) so this problem cannot occur. On a line by line basis the g++ compiler is slower than the Sun native compiler. In practice (my experience, and in the time taken for system rebuilds) it appears to be faster, because it does not do excessive recompilations.
g++ will, I expect, become the ``standard'' AIPS++ compiler in the next few months. This greatly simplifies the port of the software to new machines.
Code compiled and optimised under g++ is in my experience about 30% slower than code compiled and optimised under the Sun native compiler