summaryrefslogtreecommitdiff
path: root/Examples/python/performance
diff options
context:
space:
mode:
authorJon Schlueter <jon.schlueter@gmail.com>2015-05-08 08:33:29 -0400
committerJon Schlueter <jon.schlueter@gmail.com>2015-05-08 08:46:06 -0400
commit77707154574f1852f56ed552bab832249c80bbfc (patch)
tree658af0e04204256026ce6bb9f42a09ccbaeefbbc /Examples/python/performance
parent9086eb351ce1d158d9b66d707d3fcb48e447b382 (diff)
downloadswig-77707154574f1852f56ed552bab832249c80bbfc.tar.gz
autopep8 cleanup of Examples/python whitespace
automated cleanup only of the Examples/python example code
Diffstat (limited to 'Examples/python/performance')
-rw-r--r--Examples/python/performance/constructor/runme.py5
-rw-r--r--Examples/python/performance/func/runme.py5
-rw-r--r--Examples/python/performance/harness.py16
-rw-r--r--Examples/python/performance/hierarchy/runme.py5
-rw-r--r--Examples/python/performance/hierarchy_operator/runme.py5
-rw-r--r--Examples/python/performance/operator/runme.py5
6 files changed, 25 insertions, 16 deletions
diff --git a/Examples/python/performance/constructor/runme.py b/Examples/python/performance/constructor/runme.py
index 274cbf85e..1771fba7b 100644
--- a/Examples/python/performance/constructor/runme.py
+++ b/Examples/python/performance/constructor/runme.py
@@ -2,8 +2,9 @@ import sys
sys.path.append('..')
import harness
-def proc (mod) :
- for i in range(1000000) :
+
+def proc(mod):
+ for i in range(1000000):
x = mod.MyClass()
harness.run(proc)
diff --git a/Examples/python/performance/func/runme.py b/Examples/python/performance/func/runme.py
index f9032b9d2..760a8ab6d 100644
--- a/Examples/python/performance/func/runme.py
+++ b/Examples/python/performance/func/runme.py
@@ -2,9 +2,10 @@ import sys
sys.path.append('..')
import harness
-def proc (mod) :
+
+def proc(mod):
x = mod.MyClass()
- for i in range(10000000) :
+ for i in range(10000000):
x.func()
harness.run(proc)
diff --git a/Examples/python/performance/harness.py b/Examples/python/performance/harness.py
index 00f48e66a..c3d38b4fb 100644
--- a/Examples/python/performance/harness.py
+++ b/Examples/python/performance/harness.py
@@ -3,9 +3,10 @@ import time
import imp
from subprocess import *
-def run (proc) :
- try :
+def run(proc):
+
+ try:
mod = imp.find_module(sys.argv[1])
mod = imp.load_module(sys.argv[1], *mod)
@@ -14,15 +15,18 @@ def run (proc) :
t2 = time.clock()
print "%s took %f seconds" % (mod.__name__, t2 - t1)
- except IndexError :
- proc = Popen([sys.executable, 'runme.py', 'Simple_baseline'], stdout=PIPE)
+ except IndexError:
+ proc = Popen(
+ [sys.executable, 'runme.py', 'Simple_baseline'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
- proc = Popen([sys.executable, 'runme.py', 'Simple_optimized'], stdout=PIPE)
+ proc = Popen(
+ [sys.executable, 'runme.py', 'Simple_optimized'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
- proc = Popen([sys.executable, 'runme.py', 'Simple_builtin'], stdout=PIPE)
+ proc = Popen(
+ [sys.executable, 'runme.py', 'Simple_builtin'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
diff --git a/Examples/python/performance/hierarchy/runme.py b/Examples/python/performance/hierarchy/runme.py
index 9b22586a1..8255cdc86 100644
--- a/Examples/python/performance/hierarchy/runme.py
+++ b/Examples/python/performance/hierarchy/runme.py
@@ -2,9 +2,10 @@ import sys
sys.path.append('..')
import harness
-def proc (mod) :
+
+def proc(mod):
x = mod.H()
- for i in range(10000000) :
+ for i in range(10000000):
x.func()
harness.run(proc)
diff --git a/Examples/python/performance/hierarchy_operator/runme.py b/Examples/python/performance/hierarchy_operator/runme.py
index 5a8c52557..eabfae864 100644
--- a/Examples/python/performance/hierarchy_operator/runme.py
+++ b/Examples/python/performance/hierarchy_operator/runme.py
@@ -2,9 +2,10 @@ import sys
sys.path.append('..')
import harness
-def proc (mod) :
+
+def proc(mod):
x = mod.H()
- for i in range(10000000) :
+ for i in range(10000000):
x += i
harness.run(proc)
diff --git a/Examples/python/performance/operator/runme.py b/Examples/python/performance/operator/runme.py
index 4a6031f48..d75ae404c 100644
--- a/Examples/python/performance/operator/runme.py
+++ b/Examples/python/performance/operator/runme.py
@@ -2,9 +2,10 @@ import sys
sys.path.append('..')
import harness
-def proc (mod) :
+
+def proc(mod):
x = mod.MyClass()
- for i in range(10000000) :
+ for i in range(10000000):
x = x + i
harness.run(proc)