Globals.<clinit> takes about 1.3 seconds on a recent MacBook with SnowLeopard (Java 1.6u17) creating 9 Font objects from the same font family. It spends 90% of the time in Font.userInit$() according to NB profiler.
####
public def fontFamily = "Verdana";
public def fontFamilyBold = fontFamily;
public def font9 = Font { name: fontFamily size: 9};
public def font9bold = Font.font(fontFamilyBold, FontWeight.BOLD, 9);
public def font12 = Font { name: fontFamily size: 12};
public def font12bold = Font.font(fontFamilyBold, FontWeight.BOLD, 12);
public def font12italic = Font { name : fontFamily size: 12};
public def font16 = Font { name: fontFamily size: 16};
public def font16bold = Font.font(fontFamilyBold, FontWeight.BOLD, 16);
public def font20 = Font { name: fontFamily size: 20};
public def font20bold = Font.font(fontFamilyBold, FontWeight.BOLD, 20);
public class Globals {
}
####
####
public def fontFamily = "Verdana";
public def fontFamilyBold = fontFamily;
public def font9 = Font { name: fontFamily size: 9};
public def font9bold = Font.font(fontFamilyBold, FontWeight.BOLD, 9);
public def font12 = Font { name: fontFamily size: 12};
public def font12bold = Font.font(fontFamilyBold, FontWeight.BOLD, 12);
public def font12italic = Font { name : fontFamily size: 12};
public def font16 = Font { name: fontFamily size: 16};
public def font16bold = Font.font(fontFamilyBold, FontWeight.BOLD, 16);
public def font20 = Font { name: fontFamily size: 20};
public def font20bold = Font.font(fontFamilyBold, FontWeight.BOLD, 20);
public class Globals {
}
####