summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Smith <bruce@nanorex.com>2008-04-17 22:20:01 +0000
committerBruce Smith <bruce@nanorex.com>2008-04-17 22:20:01 +0000
commit70bf6ffe1664c9f18b74bda2a41816e07306d264 (patch)
treeabdef3df2c259be8e9a8d1a97afd2aa67dc81886
parent5d654ed247d492602a50b0472d70afea8d3829da (diff)
downloadnanoengineer-theirix-70bf6ffe1664c9f18b74bda2a41816e07306d264.tar.gz
nanoengineer-theirix-70bf6ffe1664c9f18b74bda2a41816e07306d264.zip
comments about possible big speed hit due to Q.__setattr__ method
-rwxr-xr-xcad/src/geometry/VQT.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/cad/src/geometry/VQT.py b/cad/src/geometry/VQT.py
index 273eb346f..2db53c5b6 100755
--- a/cad/src/geometry/VQT.py
+++ b/cad/src/geometry/VQT.py
@@ -394,7 +394,18 @@ class Q(DataMixin):
del self.__dict__['matrix']
def __setattr__(self, attr, value):
- #bruce comment 050518: possible bug (depends on usage, unknown): this doesn't call __reset
+ #bruce comment 050518:
+ # - possible bug (depends on usage, unknown): this doesn't call __reset
+ #bruce comments 080417:
+ # - note that the x,y,z used here are *not* the same as the ones
+ # that would normally be passed to the constructor form Q(W, x, y, z).
+ # - it is likely that this is never used (though it is often called).
+ # - the existence of this method might be a significant slowdown,
+ # because it runs (uselessly) every time methods in this class
+ # set any attributes of self, such as vec or counter.
+ # If we can determine that it is never used, we should remove it.
+ # Alternatively we could reimplement it using properties of a
+ # new-style class.
if attr == "w":
self.vec[0] = value
elif attr == "x":