Guest User

Untitled

a guest
Feb 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. start_time = time.clock()
  2. f = open (DICT_FILE)
  3. word_list = dict.fromkeys(f.read().split('\n'))
  4. f.close()
  5. logging.info('It took %f to load the dictionary using method 2.' % (time.clock() - start_time))
  6.  
  7. start_time = time.clock()
  8. with open(DICT_FILE) as f:
  9.     word_set = set(f.read().splitlines())
  10. f.close()
  11. logging.info('It took %f to load the dictionary using set method.' % (time.clock() - start_time))
  12.  
  13. start_time = time.clock()
  14. with open(DICT_FILE) as f:
  15.     word_frozenset = frozenset(f.read().splitlines())
  16. f.close()
  17. logging.info('It took %f to load the dictionary using frozenset method.' % (time.clock() - start_time))
Add Comment
Please, Sign In to add comment