Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / Object load performance degrades exponentially

Author
Message
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 02:25 Edited at: 7th Aug 2007 22:57
I don't see why performance degrades so rapidly when loading objects. This example program loads 4000 planes sequentially and hides them.

A few questions come to mind:

* Why is program fps impacted so severely when nothing is being drawn on the screen?
* If object x takes y seconds to load why should the 4000th iteration of object x take many more times the amount of time to load than the first? 4000 objects isn't all that many, really.

Object detail does not seem to affect frame rate. Comparing 4000 plains against 4000 spheres I get the same 97 fps.

This is quite sad, I think. There should be no reason for such abysmal performance as this.



I'm running a Core 2 Duo E4300 with 4GB of DDR2 800 and a GeForce 8800 GTS and I get 97fps with 4000 objects sitting idle in memory and six characters being drawn on the screen.

I would like to bring back this post for discussion. Performance is even worse when adding limbs.



Because for whatever reason object loading is painfully slow and screen performance drops considerably even with idle objects, I considered using limbs instead because DBP seems to care less about the number of idle limbs there are than objects and does not suffer a considerable loss of fps.

Limbs however seem to have a compounded problem when loading too many onto a single object.

Quote: "Lee: Not convinced over the 'limbs rule, objects go home' argument. It is not recommended making any significant object construction code in your main game loop where performance is a factor. You do not want your end users waiting around for stuff that could have been done during a pre-processing step, or suffering lag due to run-time building of matter that could have easily been done before the tight game loop."


In my situation I tried to pre-process limbs but cannot create them in any significant quantity to provide a useful alternative to objects. Limbs are considerably slower to create than objects.

Oh, I suppose I could create 100 objects which hold 40 limbs each and cross-reference them to a different parent but that would be a ridiculous (although viable) work-around. That would allow me to link 4000 limbs to a single object in a fraction of the time. And for those of you who would disagree please bear in mind that I am speaking theory based upon what I believe DBP should be (more than) capable of handling.

http://3dfolio.com
Dr Schnitzengruber
16
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 7th Aug 2007 05:40
Remeber this, when a object is made it takes up memory( regardless if it is seen). The less memory the computer has the slower it goes so:

the objects take the same time to make, it just takes more time to do the sync command, which is what FPS is measured by.

From the office of... Dr. Schnitzengruber
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 7th Aug 2007 10:40
If you create your objects outside the loop, without a sync, the objects get created much faster. However your final frame rate is quite low as DBPro still has to analyse a list of 4000 objects to see whether to draw them or not, even if they are hidden.

Play with the EXCLUDE OBJECT ON command instead of hiding objects as it physically removes the object from the render list and so things speed up a lot. This still leaves you with 4000 identical objects though. So the idea is to have one master object and then use INSTANCE OBJECT to make the 3999 'duplicates'. These duplicates share the same data as its source and you will see your frame rate rocket.

Boo!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2007 13:23
Quote: "If object x takes y seconds to load why should the 4000th iteration of object x take many more times the amount of time to load than the first? 4000 objects isn't all that many, really."


Because all sorts of internal lists referencing the new object need to be updated perhaps? - and depending how that is done the time taken could increase alarmingly. For example, DBP needs only to search through some kind of "list" of objects for a "free" slot for loading times to increase this way. I'm guessing though.

But Spooky's advice is sensible. I try not to create/delete objects in the main loop - it's well-known to degrade performance.
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 16:50 Edited at: 7th Aug 2007 16:52
Quote: "Play with the EXCLUDE OBJECT ON command instead of hiding objects as it physically removes the object from the render list and so things speed up a lot. This still leaves you with 4000 identical objects though. So the idea is to have one master object and then use INSTANCE OBJECT to make the 3999 'duplicates'. These duplicates share the same data as its source and you will see your frame rate rocket."


This is just an example. This could easily be a case of 4000 different objects and the same problem would hold true. I proved this by loading 4000 detailed spheres instead of 4000 simple plains.

Quote: "Play with the EXCLUDE OBJECT ON command instead of hiding objects as it physically removes the object from the render list and so things speed up a lot. This still leaves you with 4000 identical objects though. So the idea is to have one master object and then use INSTANCE OBJECT to make the 3999 'duplicates'. These duplicates share the same data as its source and you will see your frame rate rocket."


My point was to show that the slowdown is caused by whatever DBP does internally in the background, regardless of what's visible on the screen. And yes, I understand that sync does slow down object loading but it is necessary in my example for illustrative purposes.

Quote: "For example, DBP needs only to search through some kind of "list" of objects for a "free" slot for loading times to increase this way. I'm guessing though."


As fast as computers are today scanning a list from 1 to 4000 should be a minute task for even an archaic computer.

If DBP is scanning a list from 1 to x every time it creates objects/updates objects then that's just terrible.

For example, an object list can be maintained where object 1,834,732 would take just as long to load or delete from memory as object 5 if the index and data were to be separated. The data could be stored in a singly linked list with an additional array used to store object IDs.

What I'm trying to say is that loading 4000 simple objects into memory is a menial task and should not be so terribly taxing on an engine. It would be another whole conversation about why DBP uses so many resources to keep track of idle objects.

http://3dfolio.com
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 7th Aug 2007 21:17 Edited at: 7th Aug 2007 21:19
I have never understand who on earth will ever need to load 4000+ objects in a real time game engine meant solely for real time game experience not for some slow rendering of architectural houses or stuff.

Mistrel - this is a game engine and in any game you should make use of fewer objects in scene as possible to keep the performance high
...I still remember those days when a texture of 256x256 was like super HD image with ultra realistic data and only few games could allow level designers to use them in games. Half-Life if I remember correctly had a texture limit of 4 or a bit more megs on a single map. That means you could not use totally more than 4 megs of texture data. Everything has its limits even the unleashed raw power of DBPro

Imagine that DBPro is designed to use only 1000 unique objects in scene. It is way better for us to determine how much objects we would like to use rather than Lee would leave us with a hard coded limit of max objects per scene to keep the FPS high. You cant force a game engine to do everything you like ... IMO.

PentiumIV 1.60GHz, 256MB, NVIDIA GeForce FX 5200 128MB, AC'97, WinXP Pro SP2, DirectX 9.0c (Feb2007), DBPro 6.6b
http://www.myspace.com/producerolby
http://www.olby.times.lv
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 22:03 Edited at: 7th Aug 2007 22:16
Quote: "I have never understand who on earth will ever need to load 4000+ objects in a real time game engine.."


You don't have to understand. I'm arguing load times and not theory. My point is valid.

Quote: "Mistrel - this is a game engine and in any game you should make use of fewer objects in scene as possible to keep the performance high.."


Yes, I agree but bear in mind that this is a synthetic test and not a game.

Quote: "Imagine that DBPro is designed to use only 1000 unique objects in scene."


TGC didn't say anything about DBPro only supporting 1000 unique objects. Actually, DBP supports up to 22 million unique objects. This can be proved by example:



I would also disagree with this artificial limit and believe it should be set to an unsigned long but if you were to see me complaining about that as a bug then you might have an argument. However, I do believe that with todays technology 22 million is more than enough.

http://3dfolio.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2007 23:31
Quote: "As fast as computers are today scanning a list from 1 to 4000 should be a minute task for even an archaic computer."


Agreed - but it depends on what else it is doing. Is it (unnecessarily) shuffling everything around every time a new object is created or deleted? Something must be causing the slow-down.

Quote: "My point was to show that the slowdown is caused by whatever DBP does internally in the background, regardless of what's visible on the screen."


I thought that was my point too! Looks like we are more or less agreed.

Quote: "If DBP is scanning a list from 1 to x every time it creates objects/updates objects then that's just terrible."


It wouldn't surprise me at all. I know of at least one University computer system where it took ages for users to log on - it turned out it was just because the software writers were too lazy to write a more efficient logon script, i.e. the code was doing exactly what you've just described.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Sep 2008 14:37
There is an issue here, but not the one you are describing.

If you measure just the loading time (and not the drawing time), it's fairly consistent all the way. BUT the drawing time does increase, and I imagine that must be because of the data interrogation as already described. Check my updated test using your code:



One thing that happened in my test was that it hit a wall at about 5500 objetcs, where it slowed dramatically.

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 8th Sep 2008 21:16
This looks to be a natural result of increased memory creation over time as the application consumes more heap. Nothing obvious to optimize, but perhaps we can look at this again in later optimization sessions.

"Small, smart and running around the legs of dinosaurs to find enough food to survive, bedroom coders aren't extinct after all "
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 16th Feb 2009 14:57
This issue has since been recognised as a delay caused by the internal sorting algorithm which is triggered each time a new object is created. The solution is not to call SYNC during your object creation step to avoid 5999 calls to the object re-sort. It is good coding to ensure all your creation steps happen before you begin your main loop. There should be very little (if any) creation work happening in your main game loop, which should be tight and highly controlled.

And lo, after much toil, he placed his keyboard on the ground and lo, he saw that it was good. Then his PC crashed, and lo, he saw that is wasn't good enough!

Login to post a reply

Server time is: 2024-04-20 16:45:27
Your offset time is: 2024-04-20 16:45:27