Jump to content

About performance optimization


BlackMojito
 Share

Recommended Posts

I have two questions.

1. On the first screenshot, why do I have such enormous "idle" time? It seems that it is even longer than the "render" function itself. How can I improve that?

2. On the second screenshot, it seems that PBRBaseMaterial is too much time-consuming. How can I reduce that? Is this time related to frequent shader program switch?

2.jpg

Developer Tools - httplocalhost8081index.htmlprojectId=2c9180825f89ebd3015fb9afb99e02ff&documentId=eedb2c5a53cd4eaf967ccf894b94266.jpg

Link to comment
Share on other sites

1. because the engine loop calls rendering on requestAnimationFrame, so it's synced to a 60Hz monitor. So its a good thing, the rendering is faster than needed. Try it on a slower machine or add some few hundred meshes and physics, you quickly run out of that idle time ;)
2. This looks really fast to me, the graph is 0.7ms from left to right... at 60Hz you have 16.777ms for every frame, so it's nice.

You will only now what to optimize when you got a really high load.
I try to test everything on my 3yrs old PC with GTX970 and i7 4790K, and my 6yrs old PC with Radeon 7970 and Phenom II X6 1090T. So older and older machines, new and old phones etc.

 

 

Link to comment
Share on other sites

I found one thing we might be able to optimize.

In PBRBaseMaterial.bindForSubMesh(), we do this._afterBind(mesh); while in StandardMaterial.bindForSubMesh(), we do this._afterBind(mesh, this._activeEffect); The active effect is actually never cached for PBR materials.

So for PBR materials, 

var mustRebind = this._mustRebind(scene, effect, mesh.visibility);

returns always false. Which leads to wasting a lot of time on rebinding stuff...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...