-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up on, saving to cloud #214
Changes from 28 commits
c13ba38
9154578
8cef147
c63a554
a070be3
2b33bc1
6821301
68651b3
c5b439a
bca7ce2
1131ec5
7f4df0d
df748a0
30b9510
f39af76
e7ceff9
69de6dc
6150c46
feba5d1
c1d8702
0a18e80
e150bd6
1fd874d
a7d304e
64cfa43
0d24ef4
75bc57e
daa2a9a
45d0c0c
6c3e9ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had it as threads because it's IO that's intensive, as opposed to compute, in each iteration. How come you cahnge it to processes? Also, if concurrency is set to True, why would n_jobs want to then be set to 1? Would that not make it not concurrent again? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,13 +107,18 @@ def _parallelize_generator[T]( | |
""" | ||
# TODO: Change this based on threads instead of CPU count | ||
n_jobs: int = max(cpu_count() - 1, max_connections) | ||
if os.getenv("CONCURRENCY", "True").capitalize() == "False": | ||
prefer = "threads" | ||
|
||
concurrency = os.getenv("CONCURRENCY", "True").capitalize() == "False" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, there is some funny logic here that is not clear, I will tidy up |
||
if concurrency: | ||
n_jobs = 1 | ||
log.debug(f"Using {n_jobs} concurrent thread(s)") | ||
prefer = "processes" | ||
|
||
log.debug(f"Using {n_jobs} concurrent {prefer}") | ||
|
||
return Parallel( # type: ignore | ||
n_jobs=n_jobs, | ||
prefer="threads", | ||
prefer=prefer, | ||
verbose=0, | ||
return_as="generator_unordered", | ||
)(delayed_generator) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this and the below should be debug logs