Skip to content

Instantly share code, notes, and snippets.

View alexforencich's full-sized avatar

Alex Forencich alexforencich

View GitHub Profile
@alexforencich
alexforencich / lookup_bench.py
Created March 2, 2017 22:05
Rough lookup benchmark
#!/usr/bin/env python
test_int_list = [0,1,2,3,4,4,3,2,1,0]*10
test_str_list = ['a', 'ab', 'abc', 'abcd', 'efgh', 'efgh', 'abcd', 'abc', 'ab', 'a']*10
def lookup_if_int(cond, arg):
val = None
if cond == 0:
val = arg+1
elif cond == 1: