Commits

Anonymous committed e8775ca Draft

Add boundmethods

  • Participants
  • Parent commits ee1a5eb

Comments (0)

Files changed (1)

timings/time_variable_access.py

         oct; oct; oct; oct; oct
 
 class A:
-    pass
+    def m(self):
+        pass
 
 def read_classvar(trials=trials, A=A):
     A.x = None
         a.x;    a.x;    a.x;    a.x;    a.x
         a.x;    a.x;    a.x;    a.x;    a.x
 
+def read_boundmethod(trials=trials, a=A()):
+    for t in trials:
+        a.m;    a.m;    a.m;    a.m;    a.m
+        a.m;    a.m;    a.m;    a.m;    a.m
+        a.m;    a.m;    a.m;    a.m;    a.m
+        a.m;    a.m;    a.m;    a.m;    a.m
+        a.m;    a.m;    a.m;    a.m;    a.m
+
 def write_local(trials=trials):
     v_local = None
     for t in trials:
     from timeit import Timer
 
     for f in [read_local, read_nonlocal, read_global, read_builtin,
-              read_classvar, read_instancevar,
+              read_classvar, read_instancevar, read_boundmethod,
               write_local, write_nonlocal, write_global,
               write_classvar, write_instancevar,
               loop_overhead]: