Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  profiling  (Read 857 times)
0 Members and 1 Guest are viewing this topic.
Offline ChouChou

Senior Newbie





« Posted 2010-06-22 08:18:45 »

Dear JGO Members,

I've read the guide in the java2D section about profiling, I've tried passing the variables as argument in Eclipse but still can't get it to work. Sorry that I'm pretty new to profiling it would be really nice if someone can shade me some light on how profiling works. Thanks in advance!


Edit: After abit more search I found out -Xpro can do profiling, did it on CMD, but I'm not sure exactly what those mean, like what's good it terms of performance and whats bad?
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
C:\>java -jar -Xprof GGt.jar

Flat profile of 34.68 secs (3128 total ticks): AWT-Windows

  Interpreted + native   Method
 99.7%     0  +  3119    sun.awt.windows.WToolkit.eventLoop
  0.1%     2  +     0    sun.awt.AWTAutoShutdown.setToolkitBusy
  0.0%     1  +     0    sun.reflect.NativeMethodAccessorImpl.invoke
  0.0%     1  +     0    sun.awt.SunToolkit.wakeupEventQueue
  0.0%     0  +     1    java.lang.Object.hashCode
  0.0%     0  +     1    sun.awt.windows.WToolkit.init
 99.9%     4  +  3121    Total interpreted

     Compiled + native   Method
  0.1%     0  +     3    sun.awt.AWTAutoShutdown.setToolkitBusy
  0.1%     0  +     3    Total compiled


Flat profile of 0.11 secs (7 total ticks): Thread-1

  Interpreted + native   Method
100.0%     0  +     7    sun.awt.windows.WToolkit.shutdown
100.0%     0  +     7    Total interpreted


Flat profile of 34.70 secs (3127 total ticks): AWT-EventQueue-0

  Interpreted + native   Method
 31.0%     0  +    26    sun.awt.windows.WFramePeer.setState
 23.8%     0  +    20    sun.awt.windows.WGlobalCursorManager.setCursor
 13.1%     0  +    11    sun.awt.windows.WGlobalCursorManager.findHeavyweightUnd
erCursor
  9.5%     0  +     8    sun.awt.windows.WComponentPeer.nativeHandleEvent
  8.3%     1  +     6    sun.awt.Win32GraphicsDevice.enumDisplayModes
  1.2%     0  +     1    java.lang.Thread.holdsLock
  1.2%     0  +     1    java.lang.Object.clone
  1.2%     0  +     1    java.lang.Class.getInterfaces
  1.2%     0  +     1    sun.awt.windows.WComponentPeer.reshape
  1.2%     0  +     1    sun.java2d.loops.FillRect.FillRect
  1.2%     0  +     1    sun.java2d.windows.GDIBlitLoops.nativeBlit
  1.2%     1  +     0    java.awt.DisplayMode.<init>
  1.2%     1  +     0    sun.awt.AWTAutoShutdown.notifyThreadBusy
  1.2%     1  +     0    java.awt.Window.processWindowEvent
  1.2%     1  +     0    java.awt.EventQueue.setCurrentEventAndMostRecentTimeImp
l
 97.6%     5  +    77    Total interpreted

     Compiled + native   Method
  1.2%     1  +     0    sun.awt.AppContext.get
  1.2%     1  +     0    Total compiled

         Stub + native   Method
  1.2%     0  +     1    java.lang.Thread.currentThread
  1.2%     0  +     1    Total stub

  Thread-local ticks:
 97.3%  3043             Blocked (of total)


Flat profile of 34.78 secs (3134 total ticks): AWT-Shutdown

  Thread-local ticks:
100.0%  3134             Blocked (of total)


Flat profile of 34.80 secs (3136 total ticks): Java2D Disposer

  Thread-local ticks:
100.0%  3136             Blocked (of total)


Flat profile of 34.88 secs (3142 total ticks): main

  Interpreted + native   Method
  2.9%     0  +    92    sun.nio.ch.FileDispatcher.read0
  1.9%     0  +    61    sun.java2d.windows.GDIBlitLoops.nativeBlit
  1.1%     0  +    36    sun.java2d.loops.Blit.Blit
  0.4%     0  +    14    sun.java2d.loops.FillRect.FillRect
  0.4%     0  +    13    java.io.RandomAccessFile.close0
  0.2%     0  +     5    java.io.RandomAccessFile.open
  0.2%     5  +     0    java.awt.image.DataBufferByte.<init>
  0.2%     0  +     5    java.util.zip.Inflater.inflateBytes
  0.1%     0  +     4    sun.font.FontManager.populateFontFileNameMap
  0.1%     0  +     3    sun.font.FileFont.getGlyphImage
  0.1%     3  +     0    java.lang.AbstractStringBuilder.<init>
  0.1%     0  +     3    sun.java2d.loops.DrawGlyphList.DrawGlyphList
  0.1%     0  +     2    java.lang.Throwable.fillInStackTrace
  0.1%     1  +     1    sun.java2d.loops.MaskBlit.MaskBlit
  0.1%     2  +     0    java.awt.image.DataBufferInt.<init>
  0.1%     2  +     0    com.sun.imageio.plugins.png.PNGImageReader.decodePaethF
ilter
  0.0%     1  +     0    sun.font.TrueTypeFont.close
  0.0%     0  +     1    sun.awt.windows.WWindowPeer.reshapeFrame
  0.0%     1  +     0    sun.java2d.SunGraphics2D.drawImage
  0.0%     1  +     0    sun.net.www.protocol.file.Handler.createFileURLConnecti
on
  0.0%     0  +     1    java.io.RandomAccessFile.seek
  0.0%     0  +     1    sun.awt.Win32GraphicsDevice.enterFullScreenExclusive
  0.0%     0  +     1    java.lang.reflect.Array.newArray
  0.0%     0  +     1    java.io.WinNTFileSystem.list
  0.0%     1  +     0    java.awt.Rectangle.setBounds
  9.4%    43  +   251    Total interpreted (including elided)

     Compiled + native   Method
 50.7%  1591  +     0    java.awt.image.ComponentColorModel.getRGBComponent
 16.8%   529  +     0    java.awt.image.ComponentColorModel.getRGB
 15.4%   485  +     0    sun.awt.image.ByteInterleavedRaster.getDataElements
  3.5%   110  +     0    sun.java2d.loops.OpaqueCopyAnyToArgb.Blit
  1.0%    30  +     0    com.sun.imageio.plugins.png.PNGImageReader.decodePaethF
ilter
  0.2%     7  +     0    com.sun.imageio.plugins.png.PNGImageReader.decodeUpFilt
er
  0.0%     1  +     0    java.io.BufferedInputStream.read
  0.0%     1  +     0    com.sun.imageio.plugins.png.PNGImageReader.decodePass
  0.0%     1  +     0    Map.Map.paint
 87.7%  2755  +     0    Total compiled

         Stub + native   Method
  2.2%     0  +    69    sun.java2d.loops.MaskBlit.MaskBlit
  0.4%     0  +    12    java.util.zip.Inflater.inflateBytes
  0.2%     0  +     7    java.lang.System.arraycopy
  0.1%     0  +     2    java.lang.Thread.currentThread
  0.0%     0  +     1    java.io.RandomAccessFile.readBytes
  2.9%     0  +    91    Total stub

  Thread-local ticks:
  0.0%     1             Blocked (of total)
  0.0%     1             Class loader


Global summary of 34.88 seconds:
100.0%  3163             Received ticks
  0.7%    21             Received GC ticks
  0.2%     7             Compilation
  0.0%     1             Class loader

Offline JL235

JGO Coder


Medals: 10



« Reply #1 - Posted 2010-06-23 17:04:43 »

As a guess I'd say your output is listing the methods called in each running thread, the number of times it was called and the percentage of total CPU that they each used. But that is just a guess.

As an alternative I'd recommend taking a look at JVisualVM. It'll be a lot easier then profiling via the command line. Goto the bin folder of your JDK (approximately: C:/program files/java/jdk1.6.0_17/bin) and you should see 'jvisualvm.exe'. Run it and wait for it to open. Then run your game/app and it'll appear listed on the left. You then double click on it to get JVisualVM to connect.

Once it's connected you can see the memory and GC usage as well as setting it up to profile your app in greater detail.

Offline ChouChou

Senior Newbie





« Reply #2 - Posted 2010-06-24 04:28:25 »

As a guess I'd say your output is listing the methods called in each running thread, the number of times it was called and the percentage of total CPU that they each used. But that is just a guess.

As an alternative I'd recommend taking a look at JVisualVM. It'll be a lot easier then profiling via the command line. Goto the bin folder of your JDK (approximately: C:/program files/java/jdk1.6.0_17/bin) and you should see 'jvisualvm.exe'. Run it and wait for it to open. Then run your game/app and it'll appear listed on the left. You then double click on it to get JVisualVM to connect.

Once it's connected you can see the memory and GC usage as well as setting it up to profile your app in greater detail.

Ok thanks, I'll try it out now!

Edit: I have to to say this thing looks pretty cool, I'll get back to you once I understand how to read the charts in it, for some reason the "Memory" in the profiler is taking ages to load(still not loaded) but other things look good. Thanks again for the help =)


Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (46 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (32 views)
2014-07-23 20:56:16
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!