![]() |
|
|
|
#1
|
|||
|
|||
|
What do you mean by 'dynamic' objects? Are you creating objects at runtime? Are you sure the slowdown is caused by the CPU? When the frame rate drops does the update time increase? Also, have you tried disabling the other threads to see if they are causing the slowdown?
|
|
#2
|
|||
|
|||
|
Dynamic, update, threading?
The environment that is being simulated has dynamic vehicles moving on a road. The slowdown is caused by lack of CPU time, most likely due to our custom code in the simulator.
Regarding the update time, it is usually 5-6 and jumps up when the frame rate drops. Further testing that I have done shows that by excluding the moving objects in the simiulation and removing file saving via a thread the problem seems to go away. My question now is what is the most effecient way to save data while a user is exploring in the enviromnent. Currently a Python thread saves the data, is there a method to do background processing withing the API that keeps the fps as high as possible? Mike |
|
#3
|
|||
|
|||
|
Is your thread looping as fast as possible and writing data? If the thread is not a high priority then try inserting some time.sleep() statements to give other threads a chance to run.
|
|
#4
|
|||
|
|||
|
I have recently dropped the thread in place of a Director() call that save the data to a file. This improves the performance slightly, however I still notice a drop of performance from 60fps to 53fps. Is there a way to set the priority of the Director() call, to a low priority so the thread takes it time to save the file (save the file over a couple seconds as opposed to < 1 second). Adding numerious time.sleeps() does not seem to be a clean way to reduce the priority.
|
|
#5
|
|||
|
|||
|
Due to the nature of threading in Python it is not possible to set the priority of a thread. At this point adding sleep statements is probably the easiest solution. Is your file saving thread performing a lot of calculation or is it mostly writing to file? Are you writing data in small or large chunks?
|
|
#6
|
|||
|
|||
|
Just for some closure, I have avoided using a thread to save data to the file system and used the director function to handle saving. This improves performance slightly. The problem originates from somewhere else. Someone else might be posting to "Vizard 3.0 Software" regarding this issue.
Thanks for the assistance. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Improve performance with large number of onthefly objects? | Fox5 | Vizard | 7 | 04-28-2008 05:19 PM |
| massive performance hit for stereo mode | Matt | Vizard | 3 | 03-30-2004 07:32 PM |
| Improving Performance | lucalatini | Vizard | 1 | 02-10-2004 11:31 AM |