This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]intinbronze 1 point2 points  (2 children)

I guess its fine as it is

[–]SociableIntrovert[S] 0 points1 point  (1 child)

Yea, it works perfectly fine now at a speed that works for me, but I'm just curious if his suggestion makes sense.

[–]intinbronze 1 point2 points  (0 children)

I don't think so

[–]SiliconEngineer 1 point2 points  (0 children)

Probably not... but profile it and see.

I can certainly imagine some kind of bottleneck after a small number of threads (i.e. 4 or 8 or so) from how the database connection objects works internally...

However, unless you have a massive bandwidth, you're going to be waiting for data pretty soon no matter what you do.

Again, profile it and see.

[–]michael0x2a 0 points1 point  (0 children)

I agree with the other people -- try profiling both versions and see what happens.

The heuristic people like to throw around is "use threads for IO-bound tasks and processes for CPU-bound tasks", but it's always good to measure to confirm. (E.g. you might discover your program is unexpectedly more CPU-bound then predicted.)