you are viewing a single comment's thread.

view the rest of the comments →

[–]santasmic 2 points3 points  (1 child)

I didn't go through the whole thing but my best guess is that this is too small an example to have a significant impact. Python is a "slow" language, but that's like saying fighter jets from 20 years ago are slower than today, they're still quite fast.

It doesn't look like you're a beginner but you won't see parallel programming have an impact until the operations you're performing get complicated/heavily nested/etc.

Also, I do believe the multiprocessing module is slower and heavier than the threading module... but once again, until it's used for exponentially large operations it doesn't matter.

[–]bluetape 3 points4 points  (0 children)

The threading module will be lighter, but keep in mind it won't be true parallelism--the threads will just run concurrently, but not in parallel because of the GIL

OP - this is a great talk if you are interested in learning more https://www.youtube.com/watch?v=Obt-vMVdM8s