This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/python/api2_2x
Campbell Barton 6b7c4e09e8 Mathutils.Vector speedup
removed the need for casting python objects to Vectors pyobjects when performing vec/float arithmatic.
a PyObject for coercing has also been removed from the vector struct so a little less memory will be used also.


Benchmarked before and after this change
___________________________________
import Blender
v= Blender.Mathutils.Vector
m= Blender.Mathutils.Matrix

a= v(1,2,3)
b= v(3,2,1)
c= m()
t= Blender.sys.time()
for i in xrange(20000000):
        a*b
        a*10
        a/10
        a+b
        b-a
        a*c

print Blender.sys.time()-t
_______________________________________

Before 63.5sec
after 49.5

about 3 sec of that is looping
2006-10-03 05:11:33 +00:00
..
2006-08-17 21:36:56 +00:00
2006-01-16 16:34:08 +00:00
2006-05-07 14:57:58 +00:00
2006-08-28 04:44:16 +00:00
2005-07-18 03:50:37 +00:00
2006-05-20 15:44:14 +00:00
2006-08-17 21:39:49 +00:00
2005-07-18 03:50:37 +00:00
2006-07-02 21:37:06 +00:00
2006-04-21 20:27:52 +00:00
2006-08-20 11:02:31 +00:00
2006-04-21 20:27:52 +00:00
2005-09-09 01:31:10 +00:00
2006-06-04 13:16:31 +00:00
2005-07-18 03:50:37 +00:00
2006-10-03 05:11:33 +00:00
2006-05-25 16:45:24 +00:00
2006-05-25 16:45:24 +00:00
2005-11-29 05:08:29 +00:00
2005-07-18 03:50:37 +00:00
2006-05-22 14:19:52 +00:00
2006-07-06 21:51:54 +00:00
2005-11-29 05:08:29 +00:00
2006-08-21 14:36:11 +00:00
2005-10-03 22:06:16 +00:00
2005-12-13 14:29:56 +00:00
2005-08-05 17:00:26 +00:00
2006-08-14 16:29:11 +00:00
2005-07-18 03:50:37 +00:00
2006-08-28 04:44:16 +00:00
2006-08-28 04:44:16 +00:00
2005-07-18 03:50:37 +00:00
2005-07-18 03:50:37 +00:00
2005-07-18 03:50:37 +00:00
2006-01-23 22:05:47 +00:00
2006-08-28 04:44:16 +00:00
2006-10-03 05:11:33 +00:00
2006-10-03 05:11:33 +00:00
2006-06-08 19:05:58 +00:00
2005-07-18 03:50:37 +00:00