[ create a new paste ] login | about

Link: http://codepad.org/Ckevfqmq    [ raw code | output | fork ]

Python, pasted on Apr 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import time

t = time.time

def gen(n):
  return "foo = 2\n" + "# comment\n" * n + "\nfoo = 1\n"

for x in xrange(100000, 1000000, 100000):
  code = gen(x)
  t0 = t()
  cd = compile(code, ".", "exec")
  exec cd
  t2 = t()
  print "%d %.3f %.3f" % (len(code), (t2-t0)*1000, (len(code) / ((t2-t0)*1000)))


Output:
1
2
3
4
5
6
7
8
9
1000017 62.398 16026.438
2000017 124.400 16077.289
3000017 222.400 13489.288
4000017 279.187 14327.377
5000017 369.168 13544.014
6000017 433.055 13855.095
7000017 504.133 13885.259
8000017 639.490 12509.998
9000017 620.472 14505.109


Create a new paste based on this one


Comments: