Changeset - add6514966f8
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 10 years ago 2015-06-14 05:00:24
drewp@bigasterisk.com
looking for eval optimizations
Ignore-this: ed3028d79f293fafc63facb01c4e26e
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/Submaster.py
Show inline comments
 
@@ -46,7 +46,7 @@ class Submaster(object):
 
        return self.levels
 

	
 
    def no_nonzero(self):
 
        return (not self.levels.values()) or not (max(self.levels.values()) > 0)
 
        return all(v == 0 for v in self.levels.itervalues())
 

	
 
    def __mul__(self, scalar):
 
        return Submaster("%s*%s" % (self.name, scalar),
light9/effecteval/effect.py
Show inline comments
 
@@ -164,6 +164,10 @@ class EffectNode(object):
 
            currentSubLevel=self.currentSubLevel,
 
            ))
 

	
 
        # I think this is slowing effecteval. Could we cache results
 
        # that we know haven't changed, like if a curve returns 0
 
        # again, we can skip an eval() call on the line that uses it
 
        
 
        for c in self.codes:
 
            codeNs = ns.copy()
 
            codeNs.update(c.pyResources)
0 comments (0 inline, 0 general)