What do I need to understand about Python multiprocessing to have faster instead of slower code? Obviously doing something super wrong. 
-
-
Replying to @o_guest
it actually can work slower if you use too many cores. Try with 2 or 4 to see if it's speeding up.
1 reply 0 retweets 1 like -
-
I tried with 2 and 4 also just to be clear.
1 reply 0 retweets 0 likes -
Replying to @o_guest
I've just seen your code. Not sure if it might be due to apply_async? I usually do this: https://pastebin.com/uJVvpYqv
1 reply 0 retweets 1 like -
Replying to @draxus
I'll try your way. But like
@seaandsailor was saying it could be that I'm not doing enough on each worker? Turbo thanks for code I'll try.
1 reply 0 retweets 1 like -
OK, so I don't actually understand your way, sorry. You have to bear in mind I used multiprocessing for the first time yesterday.
1 reply 0 retweets 0 likes -
for example where you define your arguments why are you using itertools.product?
1 reply 0 retweets 0 likes -
does that mean I have to use itertools.combinations? my loop is outside all this... hmm...
2 replies 0 retweets 0 likes -
I'll try some other solutions first as I don't grasp how to modify your example for my code (yet!) — I am not sure how the outer loop works.
1 reply 0 retweets 0 likes
Probably adapted wrongly:https://github.com/oliviaguest/pairwise_distance/blob/master/pairwise_distance.py …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.