Guest User

Untitled

a guest
Sep 25th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. ~lines 940 of babel/messages/frontend.py
  2.  
  3. extracted = extract_from_dir(dirname, method_map, options_map,
  4. keywords, options.comment_tags,
  5. callback=callback,
  6. strip_comment_tags=
  7. options.strip_comment_tags)
  8. # I'm hoping to see which takes more time, extracting or writing, in sum.
  9. # If writing dominates, parallelizing doesn't help. If they're equal, we
  10. # could see some gains on that half of the process. I'm hoping extracting
  11. # takes longer so we can have big gains.
  12. import time
  13. single_write = time.time()
  14. total_time_extracting = 0
  15. total_time_writing = 0
  16. for filename, lineno, message, comments, context in extracted:
  17. single_extract = time.time()
  18. # print "Single extract took: "
  19. # print single_extract - single_write
  20. total_time_extracting += single_extract - single_write
  21. filepath = os.path.normpath(os.path.join(dirname, filename))
  22. catalog.add(message, None, [(filepath, lineno)],
  23. auto_comments=comments, context=context)
  24. single_write = time.time()
  25. # print "Single catalog add took: "
  26. # print single_write - single_extract
  27. total_time_writing += single_write - single_extract
  28.  
  29. print "Total time extracting: "
  30. print total_time_extracting
  31.  
  32. print "Total time writing: "
  33. print total_time_writing
Advertisement
Add Comment
Please, Sign In to add comment