The Physics 04 workload was intended to stress the physics engine of OpenSim. Although the workload does drive cpu core utilization over 100% (on a quad core system), the profiler reports that most of the cpu cycles are spent processing script events and adding and removing objects and scripts from the scene. These activities (and not physics) account for 75% of the total cycles as shown here:
|
| Click to enlarge image |
One function stands out in the Smart Thread Pool code that should probably only be enabled in a DEBUG build. It uses 13% of the cycles for the entire run simply updating the last time a thread was seen alive. It's not apparent that this is needed for the thread pool to function and a comment indicates that it is only for debugging.
|
| Click to enlarge image |
By commenting out the 2 lines which access the hash to update the date/time, it looks to make a small decrease in the CPU utilization of Physics 04, especially during the ramp up to steady state. The following graphs are both synchronized in time with one showing the optimized results. It's a small difference, but one of probably many simple optimizations that may be available to existing code.
![]() |
| Click to enlarge image |
Some seemingly trivial functions consume as much as 20% of cpu cycles. Optimizations in these areas could allow for a much larger number of scripted physical objects to actually put a load on the physics engine portion of the code.
|
| Click to enlarge image |