Horde3D http://www.horde3d.org/forums/ |
|
Why is Find Nodes being Called so many times? http://www.horde3d.org/forums/viewtopic.php?f=2&t=1576 |
Page 1 of 1 |
Author: | Orm [ 06.09.2011, 18:56 ] |
Post subject: | Why is Find Nodes being Called so many times? |
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. |
Author: | MistaED [ 07.09.2011, 06:35 ] |
Post subject: | Re: Why is Find Nodes being Called so many times? |
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 ![]() |
Author: | Orm [ 07.09.2011, 12:56 ] |
Post subject: | Re: Why is Find Nodes being Called so many times? |
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. |
Author: | Volker [ 07.09.2011, 13:37 ] |
Post subject: | Re: Why is Find Nodes being Called so many times? |
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. |
Author: | Orm [ 08.09.2011, 01:13 ] |
Post subject: | Re: Why is Find Nodes being Called so many times? |
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. |
Author: | Orm [ 08.09.2011, 01:14 ] |
Post subject: | Re: Why is Find Nodes being Called so many times? |
And now for something completely different ![]() |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |