Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start_time = time.clock()
- f = open (DICT_FILE)
- word_list = dict.fromkeys(f.read().split('\n'))
- f.close()
- logging.info('It took %f to load the dictionary using method 2.' % (time.clock() - start_time))
- start_time = time.clock()
- with open(DICT_FILE) as f:
- word_set = set(f.read().splitlines())
- f.close()
- logging.info('It took %f to load the dictionary using set method.' % (time.clock() - start_time))
- start_time = time.clock()
- with open(DICT_FILE) as f:
- word_frozenset = frozenset(f.read().splitlines())
- f.close()
- logging.info('It took %f to load the dictionary using frozenset method.' % (time.clock() - start_time))
Add Comment
Please, Sign In to add comment