aboutsummaryrefslogtreecommitdiff
path: root/TestProfile.py
diff options
context:
space:
mode:
authorGravatar Thomas B Thompson <tbent@spice.(none)>2011-01-04 00:04:05 -0500
committerGravatar Thomas B Thompson <tbent@spice.(none)>2011-01-04 00:04:05 -0500
commit134de4472d3f2fa913944770595de9221dd27fdf (patch)
treecf83e29a1ef4931a15f9b30125fedbd8fba8caf9 /TestProfile.py
parentf9aeaf10e3c9077504a78374640e79415734546b (diff)
worked on profiling, made a bunch of changes, huge speedup!
Diffstat (limited to 'TestProfile.py')
-rw-r--r--TestProfile.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/TestProfile.py b/TestProfile.py
new file mode 100644
index 0000000..eccb884
--- /dev/null
+++ b/TestProfile.py
@@ -0,0 +1,34 @@
+import cProfile
+from LightInstallation import main
+numiter = 10000000
+def main1():
+ for i in xrange(0,numiter):
+ if 'abc' == 'def':
+ pass
+ if 'abc' == 'abc':
+ pass
+
+def main2():
+ for i in xrange(0,numiter):
+ if 1 == 2:
+ pass
+ if 1 == 1:
+ pass
+
+x = [1,2,3]
+a = []
+def abc1():
+ for i in xrange(0,numiter):
+ a = min(4, 255)
+ b = min(257, 255)
+
+def abc2():
+ for i in xrange(0,numiter):
+ a = 4 if 4 < 255 else 255
+ b = 257 if 257 < 255 else 255
+command = """abc1()"""
+cProfile.runctx(command, globals(), locals())
+
+command = """abc2()"""
+cProfile.runctx(command, globals(), locals())
+