Hi Robert,

Hi Tugkan,

My best guess would that your StateStet and Drawables aren't taking
advantage of STATIC DataVariance, if the DataVariance isn't STATIC
then the DrawTheadPerContext and
CullThreadPerCameraDrawTheadPerContext threading models won't provide
any frame overlap and won't provide any improvement in performance.

I am loading an IVE file where I explicitly set STATIC data variance during file generation. I will double check this to be sure.


Another thing to check up on is compiler optimization - make sure it's enabled.

I used standard configure with "cmake . -DCMAKE_BUILD_TYPE=Release" .

Finally have a look at what type of ref counting has been implemented,
ideally cmake should have chosen atomic ref counting.  Have a look at
the include/OpenThreads/Config file for what type of ref counting has
been selected.  It does sound like you might be stuck using Mutex
based ref counting.

include/OpenThreads/Config has
_OPENTHREADS_ATOMIC_USE_MUTEX
instead of
_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS

I tried to debug this. Here are my observations:

1- In CheckAtomicOps.cmake some small programs are compiled and run to see whether the architecture supports GCC_BUILTINS. I copied and pasted the one for GCC_BUILTINS to a file and tried to compile it. If I compile with "g++ test.cpp" I get following errors:

test.cpp:(.text+0x43): undefined reference to `__sync_bool_compare_and_swap_4' test.cpp:(.text+0x6e): undefined reference to `__sync_bool_compare_and_swap_4'

If I explicitly define an architecture as follows, "g++ -march=i686 test.cpp", then compile succeeds and the resulting program runs and returns successfully.


2- I changed the CheckAtomicOps.cmake so that the results of the test programs are completely ignored and SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1) is called in any case. This successfully changes include/OpenThreads/Config to use _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS. However, when I try to compile OSG I get linker errors similar to the above ones.

3- It can be seen in CMakeFiles/CMakeSystem.cmake that the architecture is correctly recognized as i686 ( SET(CMAKE_SYSTEM_PROCESSOR "i686") line is present ).

4- I saw on a different Suse 10.3 computer that it also has_OPENTHREADS_ATOMIC_USE_MUTEX.


I don't have much experience with cmake system so I don't know how I should continue with debugging. Can you give me some pointers?


Tugkan








Robert.

On Thu, Dec 4, 2008 at 12:13 PM, Tugkan Calapoglu <[EMAIL PROTECTED]> wrote:

Hi All,

I have been working on performance issues because after we ported our engine
to OSG2.7.6 we lost some performance.

In my tests I am using a complex town database which is pretty
representative for our applications. I use osgviewer for the tests.
I tested with several versions of OSG starting from 0.99 and I observe a
gradual degredation of performance from 0.99 to 2.7.6

Most notably, the frame rate I get in 2.7.6 with
CullThreadPerCameraDrawThreadPerContex is not any better than one I get from
OSG0.99. Other threading modes give even worse results.

It is expected that thread syncronization adds some overhead but I was
hoping to get overall better performance from new multithreading models.

Here are some of my observations:
- From SVN revision 7327 to 7328 a significant loss of cull performance is
observed. I found out that this is due to the addition of
#define OSGUTIL_RENDERBACKEND_USE_REF_PTR
I made some tests and measured following for SingleThreaded case:
in 7327 cull time is ~1.15
in 7328 cull time is ~1.65
in 7328 where thread safe ref/unref is turned off cull time is ~1.35

- cull time gets even worse from 7328 onward. In latest SVN version I have
1.95 ms in SingleThreaded mode. I couldn't find yet where the performance
loss occurs.

- A similar performance loss is observable in draw times but I didn't have
time yet to look closer at it.


Did anybody else compared old OSG versions to newer ones? How was your
results?


Tugkan
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to