Hi Lukasz,

my experience with assembly optimizing is opposite to yours.
At first, you have to make sure that compiler-optimized code can use at least 
the same instruction set that you hand-optimized. My gcc on 32-bit Linux is 
not using SSE by default, thus I would not wonder that you can get 4x faster 
calculations by writing SSE code. Compilers are quite good in placing 
instructions to the pipeline. You will never be able to think as far as 
compiler does about three parallel instruction pipelines delivering 
microinstructions to five execution ports while each port can execute only 
certain set of instructions and each microinstruction has different execution 
latency. To place instruction optimally, you need to experiment as well, 
measure each step you do, because things are much more complicated than they 
seem to be. Even expert on this would need to study the same for Intel, AMD, 
Atom while even different generations - P4, Core2 and i3/i5/i7 (Nahelem, Sandy 
Bridge, Haswell) behaves differently.

Ok. There is one place where human brain is sometimes more efficient - 
vectorization. Compilers often can not detect properly if they can use it, 
thus human brains can be more efficient here.

To give even one argument for optimizing: I have got one scene with 7000 
MatrixTransforms. The cull phase was quite slowed down by computing matrix 
transformations. There was nearly no geometry bellow each transformation, so 
these computations were painful. If you create a scene of 70'000 matrix 
transforms and manage to speed up the things 4x, I would vote for optimizing 
OSG. PositionAttitudeTransform can be used for testing quaternions in the same 
way, if I am not mistaken. Surely, my vote does not decides anything. It's 
Robert who decides and who knows the cost of maintenance and portability.

Anyway, it would be nice to have fast matrices....
John


On Thursday 10 of October 2013 16:19:01 Lukasz Izdebski wrote:
> Hi,
> Sebastian only usually. :)
> Have you checked how compilers compile a osg math ??
> Have you compared the for example matrices multiplication osg version and
> hand made. I've checked I notice that hand made version is about 4x faster.
> So why not have 4x time faster math :).
> 
> 
> Thank you!
> 
> Cheers,
> Lukasz
> 
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=56721#56721
> 
> 
> 
> 
> 
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.
> org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to