KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > samples > bench > Translate


1 package org.objectweb.jac.samples.bench;
2
3 import org.objectweb.jac.core.JacLoader;
4
5 public class Translate {
6
7    /**
8     * This sample shows jac's performances in class loading
9     */

10
11    public static void main(String JavaDoc args[]) throws Exception JavaDoc {
12       String JavaDoc classes[] = new String JavaDoc[] {
13          "org.objectweb.jac.core.dist.Topology",
14          "org.objectweb.jac.util.Repository",
15          "org.objectweb.jac.core.NameRepository",
16          "org.objectweb.jac.core.ApplicationRepository",
17          "org.objectweb.jac.core.ACManager",
18          "org.objectweb.jac.core.dist.rmi.RMIRemoteContainerStub",
19          "org.objectweb.jac.core.Application",
20          "org.objectweb.jac.aspects.gui.WrappableMap",
21          "org.objectweb.jac.lib.java.util.Vector",
22          "org.objectweb.jac.core.ParserImpl",
23          "org.objectweb.jac.core.rtti.RttiAC",
24          "org.objectweb.jac.ide.Method",
25          "org.objectweb.jac.ide.Project",
26          "org.objectweb.jac.ide.Application",
27          "org.objectweb.jac.ide.AspectConfiguration",
28          "org.objectweb.jac.ide.ModelElement",
29          "org.objectweb.jac.ide.Link",
30          "org.objectweb.jac.ide.Diagram",
31          "org.objectweb.jac.ide.Package",
32          "org.objectweb.jac.aspects.gui.GuiAC",
33          "org.objectweb.jac.aspects.gui.GenericFactory",
34          "org.objectweb.jac.aspects.gui.swing.SwingCustomized",
35          "org.objectweb.jac.aspects.gui.swing.ReferenceView",
36          "org.objectweb.jac.aspects.gui.swing.ObjectChooser",
37          "org.objectweb.jac.aspects.gui.swing.Tree",
38          "org.objectweb.jac.aspects.gui.swing.SwingPanelView",
39          "org.objectweb.jac.aspects.gui.swing.SwingLabel",
40          "org.objectweb.jac.aspects.gui.swing.SwingTabbedView",
41          "org.objectweb.jac.aspects.gui.swing.SwingEditorContainer",
42          "org.objectweb.jac.aspects.gui.swing.SwingContainerView",
43          "org.objectweb.jac.aspects.gui.swing.SingleSlotContainer",
44          "org.objectweb.jac.aspects.gui.swing.DesktopView",
45          "org.objectweb.jac.aspects.gui.swing.SwingMethodView",
46          "org.objectweb.jac.aspects.gui.swing.SwingFieldView",
47          "org.objectweb.jac.aspects.gui.swing.SwingTableView",
48          "org.objectweb.jac.aspects.gui.swing.List",
49          "org.objectweb.jac.aspects.gui.swing.MenuBar",
50          "org.objectweb.jac.aspects.gui.swing.Menu",
51          "org.objectweb.jac.aspects.gui.swing.ToolBar",
52          "org.objectweb.jac.aspects.gui.swing.SwingEmptyView",
53          "org.objectweb.jac.aspects.gui.swing.DateViewer",
54          "org.objectweb.jac.aspects.gui.swing.ImageURLViewer",
55          "org.objectweb.jac.aspects.gui.swing.TextViewer",
56          "org.objectweb.jac.aspects.gui.swing.BooleanEditor",
57          "org.objectweb.jac.aspects.gui.swing.FileEditor",
58          "org.objectweb.jac.aspects.gui.swing.URLEditor",
59          "org.objectweb.jac.aspects.gui.swing.DateEditor",
60          "org.objectweb.jac.aspects.gui.swing.TextEditor",
61          "org.objectweb.jac.aspects.gui.swing.PrimitiveFieldEditor",
62          "org.objectweb.jac.aspects.gui.web.Empty",
63          "org.objectweb.jac.aspects.gui.web.Customized",
64          "org.objectweb.jac.aspects.gui.web.Panel",
65          "org.objectweb.jac.aspects.gui.web.Container",
66          "org.objectweb.jac.aspects.gui.web.SingleSlotContainer",
67          "org.objectweb.jac.aspects.gui.web.Label",
68          "org.objectweb.jac.aspects.gui.web.ReferenceView",
69          "org.objectweb.jac.aspects.gui.web.PrimitiveField",
70          "org.objectweb.jac.aspects.gui.web.Table",
71          "org.objectweb.jac.aspects.gui.web.List",
72          "org.objectweb.jac.aspects.gui.web.Tree",
73          "org.objectweb.jac.aspects.gui.web.Tabs",
74          "org.objectweb.jac.aspects.gui.web.Method",
75          "org.objectweb.jac.aspects.gui.web.Page",
76          "org.objectweb.jac.aspects.gui.web.Dialog",
77          "org.objectweb.jac.aspects.gui.web.MenuBar",
78          "org.objectweb.jac.aspects.gui.web.ToolBar",
79          "org.objectweb.jac.aspects.gui.web.Menu",
80          "org.objectweb.jac.aspects.gui.web.DateViewer",
81          "org.objectweb.jac.aspects.gui.web.ImageURLViewer",
82          "org.objectweb.jac.aspects.gui.web.EditorContainer",
83          "org.objectweb.jac.aspects.gui.web.PrimitiveFieldEditor",
84          "org.objectweb.jac.aspects.gui.web.ObjectChooser",
85          "org.objectweb.jac.aspects.gui.web.DateEditor",
86          "org.objectweb.jac.aspects.gui.web.URLEditor",
87          "org.objectweb.jac.aspects.gui.web.BooleanEditor",
88          "org.objectweb.jac.aspects.gui.CollectionWrapper",
89          "java.util.Date",
90          "java.util.Hashtable$Entry",
91          "org.objectweb.jac.ide.Projects",
92          "org.objectweb.jac.ide.Aspect",
93          "org.objectweb.jac.ide.Class",
94          "org.objectweb.jac.ide.RelationLink",
95          "org.objectweb.jac.ide.PointcutLink",
96          "org.objectweb.jac.ide.TypedElement",
97          "org.objectweb.jac.ide.Field",
98          "org.objectweb.jac.ide.Type",
99          "org.objectweb.jac.ide.Instance",
100          "org.objectweb.jac.ide.Group",
101          "org.objectweb.jac.ide.AspectMethod",
102          "org.objectweb.jac.ide.Parameter",
103          "org.objectweb.jac.ide.TypeRepository",
104          "org.objectweb.jac.ide.diagrams.ClassFigureCreationTool",
105          "org.objectweb.jac.ide.diagrams.PointcutLinkShowTool",
106          "org.objectweb.jac.ide.diagrams.RelationLinkShowTool",
107          "org.objectweb.jac.ide.Errors",
108          "org.objectweb.jac.ide.Error",
109          "org.objectweb.jac.ide.diagrams.DiagramView",
110          "org.objectweb.jac.aspects.persistence.PersistenceAC",
111          "org.objectweb.jac.aspects.persistence.FSStorage",
112          "org.objectweb.jac.lib.java.util.HashSet"};
113       JacLoader loader;
114       long start;
115
116       loader = new JacLoader(false,false);
117       loader.setWrappeeTranslator(null);
118       start = System.currentTimeMillis();
119       for (int i=0; i<classes.length; i++) {
120          loader.loadClass(classes[i]);
121       }
122       System.out.println("without translator "+(System.currentTimeMillis()-start)+"ms");
123
124       loader = new JacLoader(false,false);
125       start = System.currentTimeMillis();
126       for (int i=0; i<classes.length; i++) {
127          loader.loadClass(classes[i]);
128       }
129       System.out.println("with translator "+(System.currentTimeMillis()-start)+"ms");
130
131    }
132 }
133
Popular Tags