Horde3D

Next-Generation Graphics Engine
It is currently 27.04.2024, 09:24

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 06.09.2011, 18:56 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
I was looking for reasons why my engine is slowing down so much, and one thing that caught my eye is how many times h3dFindNodes is being called. It is hogging up the CPU quite a bit, but I am fairly certain it isn't me making the calls. The callstack shows it is being invoked by h3dRender. This is being shown to me via Intel VTune.

Here is the Hotspot Check summary:
Code:
Top Hotspots
Function   CPU Time
ZN4Irre12RenderThread15SingleThreadRunEv   5.636s - Mine
h3dFindNodes   4.189s - Here's the bugger.
ZN5OGLFT4Face4drawEh   3.140s - Unavoidable for the time being
ZN4Irre3RunEv   0.655s
ZeqRK9asCStringPKc   0.372s
[Others]   4.290s


It's odd, I thought the biggest bottleneck in my engine would be the liberal use of Angelscript, but apparently I was wrong. Here is the callstack:

Code:
IrreRendering.dll!h3dFindNodes - [Unknown]
IrreRendering.dll!h3dFindNodes+0x2f0f0 - [Unknown]
IrreRendering.dll!h3dFindNodes+0x266fd - [Unknown]
IrreRendering.dll!h3dFindNodes+0x2e1d0 - [Unknown]
IrreRendering.dll!h3dRender+0xce01 - [Unknown]
IrreCore.dll!ZN4Irre8Renderer6RenderEv+0x835fc - [Unknown]
IrreCore.dll!ZN4Irre12RenderThread15SingleThreadRunEv+0x70558 - [Unknown]
IrreCore.dll!ZN4Irre6Engine3RunEv+0x5d694 - [Unknown]
IrreCore.dll!ZN4Irre3RunEv+0x5d9be - [Unknown]
IrreEngine.exe![IrreEngine.exe]+0x13f8 - [Unknown]
IrreEngine.exe![IrreEngine.exe]+0x10da - [Unknown]
IrreEngine.exe![IrreEngine.exe]+0x1177 - [Unknown]
kernel32.dll!RegisterWaitForInputIdle+0x17076 - [Unknown]


By the way, I am on windows so VTune is currently the best option for me. I plan to doublecheck with valgrind when I run it on my Linux machine.


Top
 Profile  
Reply with quote  
PostPosted: 07.09.2011, 06:35 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi Orm,

h3dFindNodes would be part of the public API, the internal code which is accessed by h3dRender itself shouldn't use h3dFindNodes so it must be something in your code trying to find a node. Best way would be to store the handle of the node you're trying to find in some member of a class or something for quick access.

Hope this helps :D

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
PostPosted: 07.09.2011, 12:56 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Yeah, I figured that, but the weird thing is that even when I took out all the instances where I was calling h3dFindNodes it was still being called. It may be that I am misreading the report, but meh. I think the problem I was having was OS related more than anything else, because when I ran it this morning on the same (shit) hardware, it ran fine at a nice smooth 30 FPS. Very bizzare.

At any rate, FindNodes may be a thing to look at in the future if it was indeed taking up that much CPU time.


Top
 Profile  
Reply with quote  
PostPosted: 07.09.2011, 13:37 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Searching a node is always something that takes time that could be reduced by caching. So normally it shouldn't take too much time because h3dFindNodes is nothing to be called in every frame.


Top
 Profile  
Reply with quote  
PostPosted: 08.09.2011, 01:13 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Yeah, I realized that, but for a while I thought it was the only way for me to update all of the emitter nodes (h3dFindNodes(NULL,H3dNodeType::Emitter); then iterate the search result.) I actually seem to have gotten a bit of a performance boost when I had my game actors pre-cache any emitter nodes they are passed and update the cached emitters during their own update.


Top
 Profile  
Reply with quote  
PostPosted: 08.09.2011, 01:14 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
And now for something completely different


Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group