Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13510)

Issue 13857043: Use multiprocessing for faster scanning

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by ekasper
Modified:
10 years, 7 months ago
CC:
ctlog-opensource-review_google.com
Visibility:
Public.

Description

Use multiprocessing for faster scanning

Patch Set 1 #

Patch Set 2 : remove refactoring leftovers #

Total comments: 16

Patch Set 3 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -22 lines) Patch
M src/python/ct/client/tools/scan.py View 1 2 3 chunks +97 lines, -22 lines 0 comments Download

Messages

Total messages: 4
ekasper
This is a temporary hack to make the scan tool faster by spawning multiple cert ...
10 years, 7 months ago (2013-09-24 13:43:32 UTC) #1
Ben Laurie (Google)
LGTM. https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/scan.py File src/python/ct/client/tools/scan.py (right): https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/scan.py#newcode5 src/python/ct/client/tools/scan.py:5: import Queue Unless I missed something, you are ...
10 years, 7 months ago (2013-09-24 14:01:07 UTC) #2
Eran
drive-by review... https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/scan.py File src/python/ct/client/tools/scan.py (right): https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/scan.py#newcode96 src/python/ct/client/tools/scan.py:96: self.blocking = blocking nit: 'blocking' is somewhat ...
10 years, 7 months ago (2013-09-24 15:20:37 UTC) #3
ekasper
10 years, 7 months ago (2013-09-24 15:35:05 UTC) #4
https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
File src/python/ct/client/tools/scan.py (right):

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:5: import Queue
On 2013/09/24 14:01:08, Ben Laurie (Google) wrote:
> Unless I missed something, you are only using multiprocessing.Queue.

Yup, leftovers. Removed.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:82: 
On 2013/09/24 14:01:08, Ben Laurie (Google) wrote:
> Extra line.

Removed.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:96: self.blocking = blocking
On 2013/09/24 15:20:37, Eran wrote:
> nit: 'blocking' is somewhat ambiguous here. Seems like what it actually does
is
> wait for user input, so I suggest 'wait_for_user' or 'wait_for_user_ack'

Renamed to 'wait_for_ack'.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:98: def process_entries(entry_queue,
message_queue):
On 2013/09/24 15:20:37, Eran wrote:
> nit: name message_queue to output_queue so it's clear output messages go there
> (message_queue is ambiguous: unclear if it's for input or output)

Done.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:155: scan_process.start()
On 2013/09/24 14:01:08, Ben Laurie (Google) wrote:
> Why not start immediately after creation?

Done.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:165: for _ in range(len(workers)):
On 2013/09/24 15:20:37, Eran wrote:
> You could get rid of the 'worker_stopped' messages by simply looking at the
> entry_queue: When that's empty, it means each worker is at most calculating
> 'match(c)' for one certificate. You could just join() on the workers (that
would
> require timing out on entry_queue.get() in the worker)

Seems to me this in fact complicates the flow: you'd have to re-inspect the
message queue after joining the workers to see if any of them produced any more
hits.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:166: entry_queue.put((0, "STOP_WORKER"))
On 2013/09/24 15:20:37, Eran wrote:
> Sending '0' here indicates that perhaps a more structured message in the queue
> is called for. Since the count is only used for progress report, I suggest
> dropping it off entirely and so avoid using a more structured message.

But I very much like to have the progress report.

https://codereview.appspot.com/13857043/diff/4001/src/python/ct/client/tools/...
src/python/ct/client/tools/scan.py:168: elif msg.msg == "WORKER_STOPPED":
On 2013/09/24 15:20:37, Eran wrote:
> use constants rather than raw strings.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b