Jump to content
  • Advertisement
Sign in to follow this  
King of Men

[java] Help optimising?

This topic is 4926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, I'm trying to create a game using the Java3D library. Unfortunately, with only a few objects in the game world, and a single ambient light source, there are noticeable jerks and jumps. Now, I could go "OMG Java is teh slows!!!111oneoneone", but I'm not quite ready for that yet. I suspect I am doing something wrong. I've run the profiler, but I don't see any obvious trouble spots in my own code, except that there are perhaps a few too many constructions of temporary objects. On the other hand, there is a lot of activity in the Java3D infrastructure, and I'm not experienced enough to tell whether it should be there or not. So I turn here for help. First the general : Are there any pitfalls I should be avoiding that Java tutorials don't mention because they're obvious? Keep in mind that I'm new to 3D graphics, if not to Java. Second, the specific : Here's the profiler output. Does anyone see any obvious problems?
Flat profile of 2.23 secs (193 total ticks): main

  Interpreted + native   Method                        
 26.0%     0  +    47    sun.awt.windows.Win32SurfaceData.initDDraw
  7.7%     0  +    14    java.lang.ClassLoader.defineClass0
  5.0%     0  +     9    java.lang.Class.forName0
  3.9%     0  +     7    javax.media.j3d.TriangleArray.createRetained
  3.3%     0  +     6    javax.media.j3d.View.setUniverse
  2.8%     0  +     5    GothicGUI.<init>
  2.2%     0  +     4    sun.awt.windows.WComponentPeer.pShow
  1.7%     0  +     3    java.awt.Component.show
  1.7%     0  +     3    java.lang.Throwable.fillInStackTrace
  1.7%     0  +     3    javax.media.j3d.Canvas3D.<init>
  1.1%     0  +     2    java.io.WinNTFileSystem.getBooleanAttributes
  1.1%     0  +     2    sun.awt.windows.WLabelPeer.create
  1.1%     0  +     2    javax.media.j3d.SoundStructure.<init>
  1.1%     0  +     2    java.io.WinNTFileSystem.checkAccess
  1.1%     0  +     2    sun.awt.windows.D3DBlitLoops.register
  1.1%     0  +     2    sun.awt.Win32GraphicsDevice.getMaxConfigsImpl
  1.1%     0  +     2    sun.awt.Win32GraphicsDevice.isPixFmtSupported
  1.1%     0  +     2    java.lang.Object.hashCode
  1.1%     1  +     1    java.io.Win32FileSystem.normalize
  1.1%     0  +     2    java.lang.String.<init>
  1.1%     0  +     2    java.util.HashMap.maskNull
  1.1%     0  +     2    javax.media.j3d.RenderBin.<init>
  1.1%     0  +     2    sun.awt.windows.WComponentPeer.setZOrderPosition
  1.1%     0  +     2    com.sun.j3d.utils.universe.SimpleUniverse.createLocale
  1.1%     1  +     1    java.lang.String.concat
 89.0%    10  +   151    Total interpreted (including elided)

  Thread-local ticks:
  6.2%    12             Blocked (of total)
  5.0%     9             Class loader
  6.1%    11             Compilation


Flat profile of 264.34 secs (16173 total ticks): AWT-Windows

  Interpreted + native   Method                        
100.0%     0  + 16167    sun.awt.windows.WToolkit.eventLoop
  0.0%     0  +     1    sun.awt.SunToolkit.wakeupEventQueue
  0.0%     0  +     1    java.awt.EventQueue.wakeup
  0.0%     0  +     1    sun.awt.windows.WToolkit.run
  0.0%     0  +     1    sun.awt.SunToolkit.getPrivateKey
100.0%     0  + 16171    Total interpreted

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


Flat profile of 0.03 secs (1 total ticks): Thread-0

  Thread-local ticks:
100.0%     1             Unknown: no last frame


Flat profile of 263.00 secs (16059 total ticks): DestroyJavaVM

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


Flat profile of 263.09 secs (16066 total ticks): J3D-RenderStructureUpdateThread-1

  Interpreted + native   Method                        
  0.3%     0  +     5    sun.awt.Win32GraphicsConfig.getBounds
  0.1%     2  +     0    javax.media.j3d.GeometryStructure.getVisibleBHTrees
  0.1%     0  +     2    javax.media.j3d.RenderMolecule.reset
  0.1%     0  +     2    javax.media.j3d.GeometryAtom.getRenderAtom
  0.1%     0  +     2    javax.media.j3d.RenderBin.findEnvironmentSet
  0.1%     1  +     0    javax.media.j3d.RenderingEnvironmentStructure.processBgs
  0.1%     1  +     0    javax.media.j3d.CanvasViewCache.cacheEyePosition
  0.1%     1  +     0    javax.media.j3d.Transform3D.setScaleTranslation
  0.1%     1  +     0    javax.media.j3d.RenderMolecule.removeRenderAtom
  0.1%     1  +     0    javax.media.j3d.CanvasViewCache.computeViewPlatformScale
  0.1%     1  +     0    javax.media.j3d.RenderBin.removeARenderAtom
  0.1%     1  +     0    javax.media.j3d.RenderMolecule.evalAlphaUsage
  0.1%     0  +     1    javax.media.j3d.TextureBin.addRenderMolecule
  0.1%     1  +     0    javax.media.j3d.RenderBin.updateViewPlatform
  0.1%     0  +     1    javax.media.j3d.MasterControl.runMonitor
  0.1%     1  +     0    javax.media.j3d.RenderBin.computeViewFrustumBBox
  0.1%     1  +     0    javax.media.j3d.NodeRetained.getCurrentLocalToVworld
  0.1%     1  +     0    java.util.HashMap.addEntry
  0.1%     0  +     1    javax.media.j3d.RenderBin.getLightBin
  0.1%     1  +     0    javax.media.j3d.J3dThread.run
  0.1%     1  +     0    javax.media.j3d.MasterControl.getVertexArrayRenderMethod
  0.1%     1  +     0    javax.media.j3d.RenderAtom.hasSeparateLocaleVwcBounds
  0.1%     1  +     0    sun.awt.Win32GraphicsConfig.getBounds
  0.1%     0  +     1    javax.media.j3d.RenderMolecule.addRenderAtom
  1.8%    17  +    15    Total interpreted

     Compiled + native   Method                        
 26.8%   479  +     0    javax.media.j3d.BHTree.select
 23.6%   422  +     0    javax.media.j3d.GeometryAtom.isEnable
 11.3%     4  +   198    javax.media.j3d.MasterControl.runMonitor
  9.6%   171  +     0    javax.media.j3d.RenderBin.processGeometryAtom
  5.6%    96  +     5    javax.media.j3d.GeometryAtom.getRenderAtom
  1.3%    23  +     0    javax.media.j3d.RenderBin.processTransformChanged
  1.1%    20  +     0    javax.media.j3d.RenderMolecule.reset
  1.1%     2  +    17    java.util.ArrayList.remove
  0.8%    14  +     0    java.util.HashMap.get
  0.7%    12  +     0    javax.media.j3d.RenderBin.insertNodes
  0.7%    12  +     0    javax.media.j3d.BoundingBox.intersect
  0.7%    12  +     0    javax.media.j3d.RenderingEnvironmentStructure.getInfluencingLights
  0.6%    10  +     0    vtable chunks
  0.4%     8  +     0    javax.media.j3d.RenderingEnvironmentStructure.processLights
  0.4%     8  +     0    javax.media.j3d.RenderBin.removeNodes
  0.4%     7  +     0    java.util.ArrayList.indexOf
  0.3%     6  +     0    javax.media.j3d.RenderBin.insertRenderAtom
  0.3%     6  +     0    javax.media.j3d.RenderBin.findRenderMolecule
  0.3%     6  +     0    javax.media.j3d.RenderBin.processMessages
  0.3%     6  +     0    javax.media.j3d.RenderingEnvironmentStructure.getInfluencingModelClip
  0.3%     6  +     0    javax.media.j3d.J3dStructure.getMessages
  0.3%     6  +     0    java.util.ArrayList.ensureCapacity
  0.3%     5  +     0    javax.media.j3d.RenderBin.computeViewFrustumBBox
  0.3%     5  +     0    javax.media.j3d.CanvasViewCache.doComputeDerivedData
  0.3%     5  +     0    javax.media.j3d.Canvas3D.updateViewCache
 94.4%  1465  +   224    Total compiled (including elided)

         Stub + native   Method                        
  1.2%     4  +    18    java.lang.Object.hashCode
  1.2%     2  +    19    java.lang.Object.notify
  0.3%     0  +     6    java.lang.Object.wait
  2.7%     6  +    43    Total stub

  Runtime stub + native  Method                        
  0.1%     1  +     0    interpreter_entries Runtime1 stub
  0.1%     1  +     0    Total runtime stubs

  Thread-local ticks:
 88.9% 14276             Blocked (of total)
  1.1%    19             Compilation


Flat profile of 263.11 secs (16069 total ticks): J3D-BehaviorScheduler-1

  Interpreted + native   Method                        
  2.4%    66  +     1    javax.media.j3d.BehaviorScheduler.doWork
  0.5%     6  +     8    java.lang.System.currentTimeMillis
  0.2%     4  +     1    Fire.<init>
  0.1%     3  +     0    Ship.updateVelocity
  0.1%     1  +     2    javax.media.j3d.Shape3DRetained.clearLive
  0.1%     0  +     3    javax.media.j3d.TransformGroupRetained.setNodeData
  0.1%     2  +     0    javax.media.j3d.GroupRetained.doAddChild
  0.1%     2  +     0    java.lang.System.arraycopy
  0.1%     1  +     1    Ship.doDetection
  0.1%     2  +     0    javax.media.j3d.BehaviorStructure.handleAWTEvent
  0.1%     1  +     1    javax.media.j3d.BoundingBox.transform
  0.1%     0  +     2    javax.media.j3d.GroupRetained.updateTransformStates
  0.1%     0  +     2    javax.media.j3d.TriangleArray.createRetained
  0.1%     2  +     0    javax.media.j3d.Shape3DRetained.<init>
  0.1%     0  +     2    javax.media.j3d.Behavior.wakeupOn
  0.1%     0  +     2    javax.media.j3d.GeometryArrayRetained.update
  0.1%     2  +     0    java.lang.Long.toString
  0.1%     2  +     0    java.lang.ThreadLocal$ThreadLocalMap.get
  0.1%     1  +     1    javax.media.j3d.SceneGraphObject.setCapability
  0.0%     1  +     0    javax.media.j3d.CompileState.getCompileFlags
  0.0%     1  +     0    javax.media.j3d.GeometryArrayRetained.stride
  0.0%     0  +     1    javax.media.j3d.J3dMessage.<init>
  0.0%     0  +     1    java.util.ArrayList.clone
  0.0%     0  +     1    javax.media.j3d.Shape3DRetained.compile
  0.0%     1  +     0    javax.media.j3d.TransformGroupRetained.setTransform
  5.7%   119  +    37    Total interpreted (including elided)

     Compiled + native   Method                        
 10.4%   287  +     0    javax.media.j3d.GroupRetained.doRemoveChild
  9.2%   254  +     0    java.lang.String.equals
  5.3%   147  +     0    java.util.ArrayList.RangeCheck
  4.5%   124  +     0    Fire.setNumber
  3.9%    11  +    95    javax.media.j3d.MasterControl.runMonitor
  3.1%    64  +    20    UpdateManager.deleteItem
  2.6%    71  +     0    vtable chunks
  2.1%     0  +    59    javax.media.j3d.TriangleArray.createRetained
  1.6%    10  +    35    javax.media.j3d.TransformGroupRetained.setNodeData
  1.3%    29  +     7    Fire.<init>
  1.2%    33  +     0    java.util.Vector.indexOf
  1.1%    27  +     3    javax.media.j3d.GroupRetained.checkSetLive
  0.9%    23  +     3    javax.media.j3d.SetLiveState.clear
  0.9%    22  +     2    javax.media.j3d.Shape3DRetained.doSetLive
  0.8%    16  +     7    javax.media.j3d.BoundingBox.<init>
  0.7%    20  +     0    javax.media.j3d.Shape3DRetained.clearLive
  0.7%    13  +     6    Ship.update
  0.7%     9  +    10    javax.media.j3d.GroupRetained.doSetLive
  0.7%    18  +     0    javax.media.j3d.GroupRetained.clearLive
  0.6%    17  +     0    Fire.update
  0.6%    17  +     0    javax.media.j3d.BoundingBox.transform
  0.6%    16  +     1    Ship.fireAt
  0.6%    16  +     0    javax.media.j3d.MasterControl.sendMessage
  0.5%    13  +     2    javax.media.j3d.NodeRetained.<init>
  0.5%    10  +     4    javax.media.j3d.Shape3DRetained.initializeGAtom
 84.9%  2030  +   303    Total compiled (including elided)

         Stub + native   Method                        
  2.2%     2  +    58    java.lang.Object.clone
  1.2%     2  +    32    java.lang.StrictMath.acos
  0.9%     0  +    25    java.lang.Object.notify
  0.8%     0  +    22    java.lang.Object.wait
  0.5%     2  +    12    java.lang.System.arraycopy
  0.3%     1  +     6    sun.reflect.Reflection.getClassAccessFlags
  0.1%     2  +     1    java.lang.StrictMath.exp
  6.0%     9  +   156    Total stub

  Runtime stub + native  Method                        
  0.4%    11  +     0    interpreter_entries Runtime1 stub
  0.1%     4  +     0    monitorenter Runtime1 stub
  0.0%     1  +     0    new_multi_array Runtime1 stub
  0.0%     1  +     0    monitorexit Runtime1 stub
  0.0%     1  +     0    new_instance Runtime1 stub
  0.0%     1  +     0    alignment_frame_return Runtime1 stub
  0.7%    19  +     0    Total runtime stubs

  Thread-local ticks:
 82.9% 13320             Blocked (of total)
  0.5%    13             Interpreter
  2.1%    58             Compilation
  0.2%     5             Unknown: running frame


Flat profile of 263.12 secs (16069 total ticks): J3D-TransformStructureUpdateThread-1

  Interpreted + native   Method                        
  0.2%     0  +     2    javax.media.j3d.TransformStructure.processCurrentLocalToVworld
  0.2%     0  +     2    javax.media.j3d.MasterControl.runMonitor
  0.1%     1  +     0    javax.media.j3d.TransformGroupRetained.updateChildLocalToVworld
  0.1%     1  +     0    javax.media.j3d.StructureUpdateThread.doWork
  0.7%     2  +     4    Total interpreted

     Compiled + native   Method                        
 74.3%     0  +   625    javax.media.j3d.MasterControl.runMonitor
  2.0%    17  +     0    javax.media.j3d.TransformStructure.processMessages
  1.8%    15  +     0    javax.media.j3d.BoundingBox.transform
  1.7%    14  +     0    javax.media.j3d.TransformStructure.processCurrentLocalToVworld
  1.5%    13  +     0    javax.media.j3d.UnorderList.add
  1.3%    11  +     0    javax.media.j3d.TransformStructure.processGeometryAtomVwcBounds
  1.1%     9  +     0    javax.media.j3d.TransformStructure.processVwcBounds
  1.1%     8  +     1    javax.media.j3d.J3dStructure.getMessages
  1.1%     9  +     0    javax.media.j3d.Transform3D.set
  1.0%     8  +     0    javax.media.j3d.TransformGroupRetained.updateChildLocalToVworld
  1.0%     8  +     0    javax.media.j3d.Transform3D.mul
  1.0%     4  +     4    javax.media.j3d.UnorderList.shift
  0.6%     5  +     0    javax.media.j3d.BoundingBox.set
  0.6%     5  +     0    javax.media.j3d.BoundingBox.transform
  0.6%     5  +     0    javax.media.j3d.BoundingBox.updateBoundsStates
  0.5%     4  +     0    javax.media.j3d.Transform3D.transform
  0.5%     4  +     0    javax.media.j3d.MemoryFreeList.ensureCapacity
  0.4%     3  +     0    java.util.ArrayList.ensureCapacity
  0.4%     1  +     2    javax.media.j3d.J3dThread.runMonitor
  0.2%     2  +     0    javax.media.j3d.TransformGroupRetained.getUpdateChildLocalToVworld
  0.2%     2  +     0    javax.media.j3d.UnorderList.clear
  0.2%     2  +     0    java.util.ArrayList.clear
  0.2%     2  +     0    javax.media.j3d.TransformStructure.insertSort
  0.2%     2  +     0    vtable chunks
  0.1%     1  +     0    javax.media.j3d.TransformGroupRetained.processChildLocalToVworld
 93.8%   157  +   632    Total compiled (including elided)

         Stub + native   Method                        
  0.8%     1  +     6    java.lang.Object.notify
  0.7%     0  +     6    java.lang.Object.wait
  1.5%     1  +    12    Total stub

  Thread-local ticks:
 94.8% 15228             Blocked (of total)
  3.9%    33             Compilation


Flat profile of 263.15 secs (16072 total ticks): J3D-RenderingEnvironmentStructureUpdateThread-1

  Interpreted + native   Method                        
  0.2%     0  +     1    javax.media.j3d.RenderingEnvironmentStructure.insertNodes
  0.2%     0  +     1    Total interpreted

     Compiled + native   Method                        
 93.6%     0  +   500    javax.media.j3d.MasterControl.runMonitor
  0.9%     5  +     0    javax.media.j3d.RenderingEnvironmentStructure.removeNodes
  0.7%     4  +     0    javax.media.j3d.RenderingEnvironmentStructure.insertNodes
  0.7%     4  +     0    javax.media.j3d.RenderingEnvironmentStructure.processMessages
  0.2%     0  +     1    javax.media.j3d.J3dThread.runMonitor
  0.2%     1  +     0    javax.media.j3d.UnorderList.add
  0.2%     1  +     0    javax.media.j3d.Shape3DRetained.clearMirrorShape
  0.2%     1  +     0    javax.media.j3d.J3dMessage.decRefcount
  0.2%     1  +     0    javax.media.j3d.J3dStructure.getMessages
  0.2%     1  +     0    javax.media.j3d.UnorderList.toArray
 97.2%    18  +   501    Total compiled

         Stub + native   Method                        
  1.3%     0  +     7    java.lang.Object.wait
  0.4%     0  +     2    java.lang.Object.notify
  1.7%     0  +     9    Total stub

  Thread-local ticks:
 96.7% 15538             Blocked (of total)
  0.6%     3             Compilation
  0.4%     2             Unknown: no last frame


Flat profile of 263.21 secs (16078 total ticks): J3D-GeometryStructureUpdateThread-1

  Interpreted + native   Method                        
  0.3%     0  +     2    javax.media.j3d.GeometryStructure.removeNodes
  0.1%     1  +     0    javax.media.j3d.BHTree.reConstructTree
  0.1%     1  +     0    javax.media.j3d.GeometryStructure.processMessages
  0.1%     1  +     0    javax.media.j3d.BoundingBox.combine
  0.7%     3  +     2    Total interpreted

     Compiled + native   Method                        
 36.8%     1  +   274    javax.media.j3d.MasterControl.runMonitor
  9.1%    68  +     0    javax.media.j3d.BHNode.computeMaxDepth
  6.1%    10  +    36    javax.media.j3d.BHTree.computeCenterValues
  3.7%    28  +     0    javax.media.j3d.BoundingBox.combine
  3.5%    26  +     0    javax.media.j3d.BHNode.isInside
  3.3%    25  +     0    javax.media.j3d.BoundingBox.checkBoundsIsNaN
  3.1%    21  +     2    javax.media.j3d.BHTree.constructTree
  2.9%    22  +     0    javax.media.j3d.BHNode.deleteAndUpdateMarkedNodes
  2.0%    15  +     0    javax.media.j3d.BHInternalNode.insert
  1.9%    14  +     0    javax.media.j3d.BoundingBox.updateBoundsStates
  1.7%    12  +     1    javax.media.j3d.BHTree.computeMeansAndSumSquares
  1.6%    12  +     0    javax.media.j3d.BoundingBox.set
  1.6%    12  +     0    javax.media.j3d.BHNode.combineBHull
  1.5%    11  +     0    javax.media.j3d.BHNode.countNumberOfLeaves
  1.2%     9  +     0    javax.media.j3d.GeometryAtom.computeBoundingHull
  0.9%     7  +     0    javax.media.j3d.BHTree.markParentChain
  0.9%     7  +     0    javax.media.j3d.BHInsertStructure.lookupAndInsert
  0.8%     6  +     0    vtable chunks
  0.7%     5  +     0    javax.media.j3d.GeometryStructure.processMessages
  0.5%     4  +     0    javax.media.j3d.MRSWLock.writeUnlock
  0.5%     4  +     0    javax.media.j3d.J3dStructure.getMessages
  0.5%     2  +     2    javax.media.j3d.UnorderList.shift
  0.5%     2  +     2    java.util.ArrayList.toArray
  0.5%     4  +     0    javax.media.j3d.GeometryStructure.removeNodes
  0.5%     4  +     0    javax.media.j3d.GeometryStructure.addToBhNodeArr
 91.0%   362  +   319    Total compiled (including elided)

         Stub + native   Method                        
  0.8%     1  +     5    java.lang.Object.wait
  0.7%     0  +     5    java.lang.StrictMath.log
  0.3%     0  +     2    java.lang.System.arraycopy
  0.1%     0  +     1    sun.reflect.Reflection.getCallerClass
  1.9%     1  +    13    Total stub

  Runtime stub + native  Method                        
  0.3%     2  +     0    interpreter_entries Runtime1 stub
  0.1%     1  +     0    monitorenter Runtime1 stub
  0.1%     1  +     0    new_multi_array Runtime1 stub
  0.5%     4  +     0    Total runtime stubs

  Thread-local ticks:
 95.3% 15330             Blocked (of total)
  0.4%     3             Interpreter
  5.5%    41             Compilation


Flat profile of 263.33 secs (16087 total ticks): J3D-BehaviorStructureUpdateThread-1

  Interpreted + native   Method                        
  0.2%     0  +     1    javax.media.j3d.MasterControl.runMonitor
  0.2%     1  +     0    javax.media.j3d.BoundingSphere.intersect
  0.2%     1  +     0    javax.media.j3d.BehaviorStructure.processConditionMet
  0.7%     2  +     1    Total interpreted

     Compiled + native   Method                        
 90.5%     1  +   410    javax.media.j3d.MasterControl.runMonitor
  1.5%     7  +     0    javax.media.j3d.MasterControl.sendRunMessage
  1.1%     5  +     0    javax.media.j3d.BehaviorStructure.processMessages
  0.7%     3  +     0    javax.media.j3d.J3dMessage.clear
  0.7%     3  +     0    javax.media.j3d.J3dStructure.getMessages
  0.4%     2  +     0    javax.media.j3d.UnorderList.add
  0.2%     1  +     0    javax.media.j3d.J3dMessage.decRefcount
  0.2%     1  +     0    javax.media.j3d.MemoryFreeList.add
 95.4%    23  +   410    Total compiled

         Stub + native   Method                        
  2.4%     0  +    11    java.lang.Object.wait
  0.4%     0  +     2    java.lang.Object.notify
  2.9%     0  +    13    Total stub

  Thread-local ticks:
 97.2% 15633             Blocked (of total)
  1.1%     5             Unknown: no last frame


Flat profile of 263.91 secs (16136 total ticks): AWT-EventQueue-0

  Interpreted + native   Method                        
 21.6%     0  +    22    sun.awt.windows.WComponentPeer.nativeHandleEvent
  4.9%     0  +     5    sun.awt.windows.WGlobalCursorManager.findHeavyweightUnderCursor
  3.9%     0  +     4    sun.awt.windows.WGlobalCursorManager.setCursor
  3.9%     0  +     4    java.lang.Thread.yield
  2.0%     2  +     0    java.awt.Component.dispatchEventImpl
  2.0%     1  +     1    java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched
  1.0%     1  +     0    java.awt.Component.isShowing
  1.0%     1  +     0    java.awt.Component.getInputContext
  1.0%     1  +     0    java.awt.Window.getFocusTraversalKeys
  1.0%     1  +     0    sun.java2d.SunGraphics2D.invalidateClip
  1.0%     1  +     0    java.awt.Toolkit.getEventQueue
  1.0%     1  +     0    java.awt.AWTEvent.convertToOld
  1.0%     1  +     0    javax.media.j3d.EventCatcher.keyPressed
 45.1%    10  +    36    Total interpreted

     Compiled + native   Method                        
  2.0%     0  +     2    javax.media.j3d.MasterControl.runMonitor
  1.0%     1  +     0    sun.awt.AWTAutoShutdown.isReadyToShutdown
  1.0%     1  +     0    java.util.HashMap.get
  1.0%     0  +     1    java.awt.EventQueue.getNextEvent
  1.0%     1  +     0    javax.media.j3d.TransformGroupRetained.setTransform
  1.0%     1  +     0    vtable chunks
  6.9%     4  +     3    Total compiled

  Thread-local ticks:
 99.4% 16034             Blocked (of total)
  1.0%     1             Interpreter
 47.1%    48             Compilation


Flat profile of 264.01 secs (16145 total ticks): J3D-Renderer-1

  Interpreted + native   Method                        
  0.4%     0  +    38    javax.media.j3d.Canvas3D.swapBuffers
  0.3%     0  +    25    javax.media.j3d.GeometryArrayRetained.execute
  0.2%     0  +    20    javax.media.j3d.GeometryArrayRetained.buildGA
  0.0%     0  +     4    javax.media.j3d.Canvas3D.freeDisplayList
  0.0%     0  +     4    sun.awt.Win32GraphicsConfig.getBounds
  0.0%     0  +     4    javax.media.j3d.Canvas3D.callDisplayList
  0.0%     3  +     0    javax.media.j3d.J3dThread.run
  0.0%     0  +     2    java.lang.Object.wait
  0.0%     0  +     2    javax.media.j3d.DisplayListRenderMethod.render
  0.0%     0  +     2    javax.media.j3d.MaterialRetained.updateNative
  0.0%     0  +     1    javax.media.j3d.CachedFrustum.computeValues
  0.0%     1  +     0    java.util.AbstractList$Itr.<init>
  0.0%     1  +     0    javax.media.j3d.Canvas3D.updateEnvState
  0.0%     0  +     1    javax.media.j3d.Canvas3D.clear
  0.0%     1  +     0    javax.media.j3d.GeometryArrayRetained.disableGlobalAlpha
  0.0%     1  +     0    javax.media.j3d.RenderBin.updateDirtyDisplayLists
  0.0%     0  +     1    javax.media.j3d.CanvasViewCache.doComputeDerivedData
  0.0%     0  +     1    java.lang.System.arraycopy
  0.0%     1  +     0    javax.media.j3d.RenderMolecule.render
  0.0%     1  +     0    java.lang.Object.wait
  0.0%     0  +     1    javax.media.j3d.Canvas3D.setModelViewMatrix
  0.0%     1  +     0    javax.media.j3d.EnvironmentSet.updateAttributes
  0.0%     0  +     1    javax.media.j3d.CachedFrustum.computeVertex
  0.0%     1  +     0    javax.media.j3d.CachedFrustum.computeEdges
  1.2%    11  +   107    Total interpreted

     Compiled + native   Method                        
  8.5%   808  +     0    javax.media.j3d.RenderMolecule.isSwitchOn
  5.0%   480  +     0    javax.media.j3d.BoundingBox.intersect
  3.8%     6  +   351    javax.media.j3d.MasterControl.runMonitor
  2.1%   204  +     0    javax.media.j3d.DisplayListRenderMethod.render
  1.7%   165  +     0    javax.media.j3d.TextureBin.renderList
  1.1%   102  +     0    javax.media.j3d.RenderMolecule.render
  0.4%    39  +     1    javax.media.j3d.Renderer.doWork
  0.3%    27  +     1    javax.media.j3d.RenderMolecule.updateAttributes
  0.2%    18  +     0    javax.media.j3d.Canvas3D.updateState
  0.2%     8  +    10    javax.media.j3d.J3dThread.runMonitor
  0.2%    17  +     0    javax.media.j3d.Canvas3D.setModelViewMatrix
  0.2%    15  +     0    javax.media.j3d.Canvas3D.updateEnvState
  0.1%    12  +     0    javax.media.j3d.CachedFrustum.computeEdges
  0.1%    10  +     0    javax.media.j3d.VertexArrayRenderMethod.render
  0.1%     8  +     0    javax.media.j3d.CanvasViewCache.copyComputedCanvasViewCache
  0.1%     8  +     0    javax.media.j3d.CachedFrustum.computeValues
  0.1%     8  +     0    javax.media.j3d.DisplayListRenderMethod.buildDisplayList
  0.1%     7  +     0    javax.media.j3d.Transform3D.set
  0.1%     5  +     0    javax.media.j3d.RenderBin.updateDirtyDisplayLists
  0.0%     4  +     0    javax.media.j3d.AttributeBin.render
  0.0%     4  +     0    javax.media.j3d.TextureBin.render
  0.0%     4  +     0    javax.media.j3d.Canvas3D.freeResourcesInFreeList
  0.0%     3  +     0    java.lang.Math.abs
  0.0%     3  +     0    javax.media.j3d.EnvironmentSet.updateAttributes
  0.0%     3  +     0    javax.media.j3d.Transform3D.mul
 25.0%  2015  +   363    Total compiled (including elided)

         Stub + native   Method                        
 35.1%    10  +  3330    javax.media.j3d.Canvas3D.callDisplayList
  9.9%    17  +   920    javax.media.j3d.Canvas3D.setModelViewMatrix
  8.5%     0  +   811    javax.media.j3d.Canvas3D.swapBuffers
  6.9%     3  +   653    javax.media.j3d.GeometryArrayRetained.execute
  6.3%     1  +   596    javax.media.j3d.GeometryArrayRetained.buildGA
  2.3%     0  +   223    java.lang.Object.wait
  2.0%     2  +   190    javax.media.j3d.Canvas3D.freeDisplayList
  0.3%     0  +    26    java.lang.Object.notify
  0.3%     4  +    22    javax.media.j3d.Canvas3D.setViewport
  0.2%     1  +    20    javax.media.j3d.Canvas3D.endDisplayList
  0.1%     2  +    11    javax.media.j3d.Canvas3D.newDisplayList
  0.1%     1  +     8    javax.media.j3d.Canvas3D.setProjectionMatrix
  0.1%     2  +     6    javax.media.j3d.Canvas3D.beginScene
  0.1%     1  +     7    javax.media.j3d.Canvas3D.clear
  0.1%     0  +     7    javax.media.j3d.MaterialRetained.updateNative
  0.1%     2  +     3    javax.media.j3d.Canvas3D.resetTransparency
  0.0%     1  +     3    javax.media.j3d.GeometryArrayRetained.setVertexFormat
  0.0%     0  +     3    javax.media.j3d.Canvas3D.endScene
  0.0%     1  +     2    javax.media.j3d.Canvas3D.resetRenderingAttributes
  0.0%     1  +     1    javax.media.j3d.Canvas3D.resetColoringAttributes
  0.0%     0  +     1    javax.media.j3d.Canvas3D.updateMaterial
  0.0%     0  +     1    javax.media.j3d.Canvas3D.setRenderMode
  0.0%     0  +     1    javax.media.j3d.Canvas3D.resetPolygonAttributes
 72.5%    49  +  6845    Total stub

  Runtime stub + native  Method                        
  0.0%     3  +     0    interpreter_entries Runtime1 stub
  0.0%     1  +     0    monitorexit Runtime1 stub
  0.0%     4  +     0    Total runtime stubs

  Thread-local ticks:
 41.1%  6634             Blocked (of total)
  0.0%     1             Interpreter
  1.2%   116             Compilation


Flat profile of 264.09 secs (16152 total ticks): J3D-MasterControl

  Interpreted + native   Method                        
  3.8%     1  +   319    java.lang.Thread.yield
  0.1%     0  +    11    java.lang.Object.wait
  0.1%     0  +    10    javax.media.j3d.J3dThread.runMonitor
  0.1%     6  +     0    javax.media.j3d.MasterControlThread.run
  0.0%     0  +     3    javax.media.j3d.RenderBin.updateObject
  0.0%     3  +     0    javax.media.j3d.ViewCache.snapshot
  0.0%     0  +     2    java.util.HashMap.removeEntryForKey
  0.0%     1  +     0    javax.media.j3d.TextureBin.updateObject
  0.0%     1  +     0    javax.media.j3d.View.updateViewCache
  0.0%     0  +     1    javax.media.j3d.IndexedUnorderSet.toArray
  0.0%     1  +     0    javax.media.j3d.RenderingEnvironmentStructure.backClipDistanceInVworld
  0.0%     1  +     0    javax.media.j3d.MasterControl.doWork
  0.0%     0  +     1    java.util.HashMap.eq
  0.0%     1  +     0    javax.media.j3d.RenderBin.clearDirtyOrientedRAs
  0.0%     0  +     1    javax.media.j3d.MasterControl.updateTimeValues
  4.4%    15  +   348    Total interpreted

     Compiled + native   Method                        
 74.7%     4  +  6213    javax.media.j3d.J3dThread.runMonitor
  0.3%    17  +     8    javax.media.j3d.MasterControl.runMonitor
  0.2%    16  +     0    javax.media.j3d.RenderBin.updateObject
  0.1%    12  +     0    javax.media.j3d.RenderMolecule.updateRemoveRenderAtoms
  0.1%    11  +     0    javax.media.j3d.MasterControl.updateTimeValues
  0.1%     8  +     0    javax.media.j3d.Transform3D.set
  0.1%     8  +     0    javax.media.j3d.RenderBin.releaseGeometry
  0.1%     8  +     0    javax.media.j3d.ViewCache.snapshot
  0.1%     7  +     0    vtable chunks
  0.1%     7  +     0    javax.media.j3d.TransformStructure.processLastLocalToVworld
  0.1%     7  +     0    javax.media.j3d.BoundingBox.updateBoundsStates
  0.1%     6  +     0    javax.media.j3d.RenderBin.lockGeometry
  0.1%     5  +     0    javax.media.j3d.MemoryFreeList.removeLastElement
  0.1%     5  +     0    javax.media.j3d.TextureBin.removeOneRM
  0.1%     5  +     0    java.util.HashMap.get
  0.1%     5  +     0    javax.media.j3d.RenderMolecule.updateObject
  0.1%     5  +     0    java.util.ArrayList.RangeCheck
  0.0%     4  +     0    javax.media.j3d.IndexedObject.getIdxUsed
  0.0%     4  +     0    javax.media.j3d.View.updateViewCache
  0.0%     4  +     0    javax.media.j3d.TextureBin.addAll
  0.0%     3  +     0    javax.media.j3d.BoundingBox.set
  0.0%     3  +     0    java.util.HashMap.removeEntryForKey
  0.0%     3  +     0    javax.media.j3d.IndexedUnorderSet.clear
  0.0%     3  +     0    java.util.ArrayList.ensureCapacity
  0.0%     3  +     0    java.util.ArrayList.clear
 77.3%   213  +  6222    Total compiled (including elided)

         Stub + native   Method                        
 10.4%     3  +   860    java.lang.Object.wait
  5.2%     0  +   430    java.lang.Thread.yield
  1.7%     1  +   137    java.lang.Object.notify
 17.2%     4  +  1427    Total stub

  Runtime stub + native  Method                        
  0.0%     1  +     0    monitorenter Runtime1 stub
  0.0%     1  +     0    monitorexit Runtime1 stub
  0.0%     2  +     0    Total runtime stubs

  Thread-local ticks:
 48.4%  7824             Blocked (of total)
  0.0%     1             Interpreter
  1.2%    96             Compilation


Flat profile of 264.09 secs (16152 total ticks): J3D-TimerThread

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


Flat profile of 264.35 secs (16174 total ticks): AWT-Shutdown

  Interpreted + native   Method                        
100.0%     0  +     7    java.lang.Object.wait
100.0%     0  +     7    Total interpreted

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


Global summary of 265.23 seconds:
100.0% 18745             Received ticks
 12.5%  2337             Received GC ticks
  0.4%    76             Compilation
  0.8%   151             Other VM operations
  0.0%     9             Class loader
  0.1%    20             Interpreter
  0.1%    13             Unknown code

Share this post


Link to post
Share on other sites
Advertisement
Java3D is pretty slow, dude. It has many flaws, and was not aimed for games, at the beginning. Hence, the problem may not be your code.

For serious game development in Java, try out the OpenGL bindings, such as LWJGL and JOGL, or maybe a scenagraph / engine like jME / Xith3D. They are far more suitable and worth the learning. Java3D may only be useful for a simple understandin, anyway.

Son Of Cain.

Share this post


Link to post
Share on other sites
Actually, in this case the problem was apparently my code : I eliminated a lot of temporary objects from it, and the jerks disappeared. So it was probably the garbage collector running too often.

Still, it's not as fast as all that. I'll look into JOGL, though it would mean a major refactorisation, since I'm relying on the Java3d engine for my update cycle. Not to mention all those graphics objects that would have to be initialised differently.

*Thinks of work involved in such an overhaul*
*Groans despairingly*

Share this post


Link to post
Share on other sites
Quote:
Original post by King of Men
Actually, in this case the problem was apparently my code : I eliminated a lot of temporary objects from it, and the jerks disappeared. So it was probably the garbage collector running too often.

Still, it's not as fast as all that. I'll look into JOGL, though it would mean a major refactorisation, since I'm relying on the Java3d engine for my update cycle. Not to mention all those graphics objects that would have to be initialised differently.

*Thinks of work involved in such an overhaul*
*Groans despairingly*


JOGL is excellent- i'd definitely recommend using it. For some jogl tutroials i'd recommend you take a look at this lot- they certainly helped me..

jogl tutorials

OpenGL is a fairly friendly API (in my opinion anyway) so don't despair too much! Within a little time and effort you can pick the basics and probably get back to the stage you are at now. Just think of the speed and control it gives you over the GPU (not to mention all the cool features- shaders, extensions etc..) and you should have plenty of motivation to keep you going! I done the same with my software renderer a while ago and ported it to jogl and haven't looked back since. Go for it i say! [wink]

Share this post


Link to post
Share on other sites
Consider Xith3D for a quick and easy port from J3D to something speedier.
Consider LWJGL for something, um, better than JOGL in many respects. IMVHO. But I'm well known to be very biased.

Cas :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!