Skip to content

Instantly share code, notes, and snippets.

@jml
Created October 20, 2013 21:29
Show Gist options
  • Select an option

  • Save jml/7075572 to your computer and use it in GitHub Desktop.

Select an option

Save jml/7075572 to your computer and use it in GitHub Desktop.
from datetime import datetime
from StringIO import StringIO
import sys
from edn import load
def time_edn(f):
start = datetime.now()
list(load(f))
end = datetime.now()
return (end - start).total_seconds()
contents = open('../filthy-lucre/infinite-loop.edn', 'r').read().splitlines()
for i in range(1, len(contents)):
buf = StringIO(''.join(contents[:i]))
t = time_edn(buf)
print '%s,%s' % (i, t)
sys.stderr.write('%s,%s\n' % (i, t))
if i > 100:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment