amorilia/pyffi — pull request #5 by infectedsoundsystem (2011-10-20 12:31:49+00:00)
Title: More performance changes - 16% reduction in CPU time

Following on from https://github.com/amorilia/pyffi/pull/4 - it's the last commit in that bunch that doesn't work (I was checking the wrong mesh when testing it...):
https://github.com/infectedsoundsystem/pyffi/commit/283d1381371b45de7bfcfaca03f086e27c5601fa

I'm unsure why though (I think I'm missing something that should be blindingly obvious). Are the verts/uvs not always Vector3's and TexCoord's?

Anyways - this is a 16% reduction rather than 18%, still good. :)

-----

Made some changes in update_tangent_space & Vector3 to reduce overhead and prevent unnecessary creation of objects. The result is an 16% reduction in CPU time taken to optimise nif's :D

Please check the integrity of the changes, I still only have a basic understanding of what the code is actually manipulating. The optimised meshes seem fine though (same md5sums as master).

Ran against 4 copies of tenpennychandelierdark.nif using Python 3.2.2

master:

real 1m31.628s
user 2m59.182s
sys 0m0.707s

fixedperformance:

real 1m18.966s
user 2m31.680s
sys 0m0.880s