From 98bd96fbd57a94f08e8d4dd9762d8f4f306efa3c Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Mon, 22 Feb 2010 23:55:06 -0800 Subject: [PATCH] typo --HG-- rename : tests/run/dict_getitme.pyx => tests/run/dict_getitem.pyx --- .../{dict_getitme.pyx => dict_getitem.pyx} | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) rename tests/run/{dict_getitme.pyx => dict_getitem.pyx} (58%) diff --git a/tests/run/dict_getitme.pyx b/tests/run/dict_getitem.pyx similarity index 58% rename from tests/run/dict_getitme.pyx rename to tests/run/dict_getitem.pyx index 68412f7b..1e063da3 100644 --- a/tests/run/dict_getitme.pyx +++ b/tests/run/dict_getitem.pyx @@ -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 -- 2.26.2