summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bench/var-6.1-instance-attr-5.py18
-rw-r--r--tests/bench/var-8.1-namedtuple-5th.py12
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/bench/var-6.1-instance-attr-5.py b/tests/bench/var-6.1-instance-attr-5.py
new file mode 100644
index 000000000..e8d338360
--- /dev/null
+++ b/tests/bench/var-6.1-instance-attr-5.py
@@ -0,0 +1,18 @@
+import bench
+
+class Foo:
+
+ def __init__(self):
+ self.num1 = 0
+ self.num2 = 0
+ self.num3 = 0
+ self.num4 = 0
+ self.num = 20000000
+
+def test(num):
+ o = Foo()
+ i = 0
+ while i < o.num:
+ i += 1
+
+bench.run(test)
diff --git a/tests/bench/var-8.1-namedtuple-5th.py b/tests/bench/var-8.1-namedtuple-5th.py
new file mode 100644
index 000000000..2cd6d15a0
--- /dev/null
+++ b/tests/bench/var-8.1-namedtuple-5th.py
@@ -0,0 +1,12 @@
+import bench
+from _collections import namedtuple
+
+T = namedtuple("Tup", "foo1 foo2 foo3 foo4 num")
+
+def test(num):
+ t = T(0, 0, 0, 0, 20000000)
+ i = 0
+ while i < t.num:
+ i += 1
+
+bench.run(test)