typo
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 23 Feb 2010 07:55:06 +0000 (23:55 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 23 Feb 2010 07:55:06 +0000 (23:55 -0800)
--HG--
rename : tests/run/dict_getitme.pyx => tests/run/dict_getitem.pyx

tests/run/dict_getitem.pyx [moved from tests/run/dict_getitme.pyx with 58% similarity]

similarity index 58%
rename from tests/run/dict_getitme.pyx
rename to tests/run/dict_getitem.pyx
index 68412f7b3b8a4a5f0e10a427c8e477fe98a61685..1e063da3be4c987ee7258f87a7935ec96372dbaf 100644 (file)
@@ -28,3 +28,25 @@ def test(dict d, index):
     TypeError: 'NoneType' object is unsubscriptable
     """
     return d[index]
+
+def time_dict(dict d, ix, long N):
+    """
+    >>> time_dict({"abc": 1}, "abc", 1e6)
+    """
+    from time import time
+    t = time()
+    cdef int i
+    for i in range(N):
+        d[ix]
+    return time() - t
+
+def time_nondict(object d, ix, long N):
+    """
+    >>> time_nondict({"abc": 1}, "abc", 1e6)
+    """
+    from time import time
+    t = time()
+    cdef int i
+    for i in range(N):
+        d[ix]
+    return time() - t