Hey,
So I have started going through the irrlicht source code and I have come across some things I have been able to find some things that could be optimized such as the following from CAnimatedMeshSceneNode.cpp (updated trunk from https://irrlicht.svn.sourceforge.net/sv ... icht/trunk ) which should be the most up to date correct?
//---slow---
u32 size = JointChildSceneNodes.size();
for (u32 n=0;n<size;++n)
since JointChildSceneNodes.size() would get called every iteration it would slow down the for loop, if you put it in a variable it just gets accessed which is faster. Though you probably know that already I figured while I went through the code learning it more I could mark all of the things that I find that could be optimized or done better and post them somewhere... but alas I know not where they should go... As they aren't bugs I don't think I should post them there. Anyway I look forward to taking a good look at the source code
The forum here is ok for discussions about the engine code. But be careful before you say something is slow until you profiled it or looked at the resulting machine code (compiled with optimization). Guessing is nearly always wrong.
I don't know about this one - size() is inline so the compiler will probably optimize the function call away. So you mainly add another assignment here with your solution. Maybe your additional assignment would allow the compiler to use another optimization because the loop as now a guaranteed fixed size. But well - find it out if you want - use a few compilers to figure out what they produce.
yeah, I will check to see if its faster or not but I figured I would get a spot to post my findings. That was just an example that I found at the first function I looked at, it was labeled slow already by someone else who commented it.
Insomniacp wrote: it was labeled slow already by someone else who commented it.
but only bc updating the absolute position of all children is slow and should be an option just like stated there.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
I remember this coming up before. If I remember right, the results of testing showed that it was slower in debug mode, but in release mode the optimizer made it come out the exact same speed.