Skip to content

Reduce size of physics objects by 1/3

Frederic Chardon requested to merge fr3dz10/openmw:slimfast into master

I discovered by accident that if the size of the Projectile class is too big (I think the value itself is CPU dependent) performance of convexSweepTest() would degrade by up to 40%. Current size in master is still OK for me, it's in the linked MR that I increased too much.

A big contributor to the objects size is the included btTransform (128 bytes). It is safe and easy to remove it, I don't remember why I put it here in the first place but I suppose at the time the locking strategy used in the physics system didn't allow for thread safe access to the collision object transform. Fortunately that's not the case anymore. Neither Actor nor Object suffer from this issue but this MR modify them anyway. That should reduce memory usage by about 400KiB (and more importantly keep the implementations similar).

I don't know if there is a risk that this pathological degradation can happen on 0.47 on any CPU, nevertheless it can be safely cherry-picked.

Merge request reports