Re: [eigen] Patch for quaternion normalization and cross product for Vector4f

[ Thread Index | Date Index | More Archives ]

On Tue, Mar 10, 2009 at 12:38 PM, Rohit Garg <rpg.314@xxxxxxxxx> wrote:
> Well, that's the classic AoS vs SoA argument. It's just that I have
> seen many people use Vector3f where you lose vectorization. And yes, I
> am doing an app where using vec4f for 3dim vectors would be a definite
> win even without the cross product. So it is not an abstract demand.
> In this case, the perf boost may not be much but added with other
> cases, such as add, sub, dot, in a large app, it will almost always
> turn out to be better.
> SoA may be better from vectorization pov, but AoS is used more often
> simply because it is easier from a conceptual pov. IMHO, it is a small
> thing which makes vec4f much better overall and usable for stuff like
> 3d geometry. So please consider including it. If you look at the
> Bullet physics SDK, they implement vec3 routines using sse only.

yes that's true that AoS is more convenient, and I agree it might be
handy to have an optimized cross3. Honestly, when dealing with such
small vectors, if your code includes many dot/cross products,
normalizations, etc... then I doubt the speed up could be above x1.5.
Significant speedup can only come from a more high level
reorganization of your algorithm, and using complex memory layouts...

Regarding Bullet SDK, actually only some specific parts of the SDK are
vectorized by hand (using directly inline assembly and/or using
directly intrinsics) and there the base classes (matrix, vector) are
not vectorized at all.


Mail converted by MHonArc 2.6.19+