Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~lines 940 of babel/messages/frontend.py
- extracted = extract_from_dir(dirname, method_map, options_map,
- keywords, options.comment_tags,
- callback=callback,
- strip_comment_tags=
- options.strip_comment_tags)
- # I'm hoping to see which takes more time, extracting or writing, in sum.
- # If writing dominates, parallelizing doesn't help. If they're equal, we
- # could see some gains on that half of the process. I'm hoping extracting
- # takes longer so we can have big gains.
- import time
- single_write = time.time()
- total_time_extracting = 0
- total_time_writing = 0
- for filename, lineno, message, comments, context in extracted:
- single_extract = time.time()
- # print "Single extract took: "
- # print single_extract - single_write
- total_time_extracting += single_extract - single_write
- filepath = os.path.normpath(os.path.join(dirname, filename))
- catalog.add(message, None, [(filepath, lineno)],
- auto_comments=comments, context=context)
- single_write = time.time()
- # print "Single catalog add took: "
- # print single_write - single_extract
- total_time_writing += single_write - single_extract
- print "Total time extracting: "
- print total_time_extracting
- print "Total time writing: "
- print total_time_writing
Advertisement
Add Comment
Please, Sign In to add comment