You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently using pyrr for matrix operations. The main problem with pyrr is that it crates new instances for every calculation allocating a new ndarray. This is very expensive.
We should possibly also try to make the default dtype of matrix types ti be a 32 bit float as these can be converted directly into uniforms with tobytes.
Numpy:
The default depends on your system. On a 64-bit system, default types will be 64-bit. On a 32-bit system, default types will be 32-bit. There is no way to change the default short of re-compiling numpy with a different system C header.
This could mean we have to do something about pyrr.
A branch matrix-performance was crated for this. Managed to boost performance by 10% ish by doing some simple tweaks with a local branch of pyrr. It's unlikely that using pyrr will ever be efficient when drawing complex scenes. Might want to turn a solution in ModernGL for this.
From #18
We are currently using
pyrr
for matrix operations. The main problem withpyrr
is that it crates new instances for every calculation allocating a newndarray
. This is very expensive.As an example:
https://github.com/adamlwgriffiths/Pyrr/blob/a86968b7ed242017247e27ac8a0e7b84bca0c333/pyrr/matrix44.py#L223-L236
numpy.dot
has anout
parameter to store the result in an existingndarray
. This avoids memory allocation.The text was updated successfully, but these errors were encountered: