Skip to content

excessive GPU data uploads #480

@Trass3r

Description

@Trass3r

Did some profiling with VisualVM and async-profiler:
https://gistpreview.github.io/?1fb5e7be7110dfd381f0307924bc3e57/recording.html
https://gistpreview.github.io/?1fb5e7be7110dfd381f0307924bc3e57/allocations.html

A lot of performance goes down the drain due to unnecessary GPU buffer uploads.

It originates from:

  • nifty UI uploading buffers every frame: Nifty uploads a lot of data jMonkeyEngine/jmonkeyengine#2358
  • animations since PoseFrame overwrites parts of the positions buffer all the time (still the whole buffer is uploaded)
    BufferUtils.setInBuffer(interpOffset, vertexBuffer, vertIndex);
  • excessive calls of MapViewController.updateTiles even for just tagging or digging, which brute-force updates surrounding tiles as well and triggers complete re-batchings
  • torch flame billboard rotation causing updates of the whole batch
  • mesh cloning in AnimationLoader.playAnimation just for start and end animations, which leads to temporary buffers being created (glGenBuffers/glDeleteBuffers):
NativeObject.setUpdateNeeded()
VertexBuffer.updateData(Buffer)
VertexBuffer.clone()
Mesh.cloneForAnim()
Geometry.cloneFields(Cloner,Object)
MorphTrack.cloneFields(Cloner,Object)
AnimClip.cloneFields(Cloner,Object)
AnimComposer.cloneFields(Cloner,Object)
Spatial.cloneFields(Cloner,Object)
Node.cloneFields(Cloner,Object)
Spatial.clone(boolean)
Spatial.clone()
AssetUtils.loadModel(AssetManager,String,ArtResource,boolean,boolean)
AnimationLoader.loadModel(AssetManager,String,ArtResource,Node)
AnimationLoader.attachResource(Node,AnimationControl,ArtResource,AssetManager)
AnimationLoader.playAnimation(Spatial,ArtResource,AssetManager,boolean)
CreatureViewControl.playAnimation(Creature$AnimationType)
CreatureViewControl.setTargetState(Creature$AnimationType)
PlayerEntityViewState.updateCreatureModelAnimation(Spatial,Entity)
PlayerEntityViewState$CreatureModelContainer.updateObject(Spatial,Entity)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions