Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MAC with 16GB RAM and 2x8 cores - producer/consumer is SLOW; using all cores I get the worst result.  RSS feed

Adrian Burlington
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Here is the scenario: I have 40 employees and each employee has a task to perform (task comes from DB). Each employee submit at the end a list of results.
I'm using producer-consumer here to do this so my code looks like this:

So, this code works just fine's relatively slow.

I'm running this on a MAC with 16GB RAM and 2x8 cores!
When running this with nProcessors=2 I get the optimal result and yet it's slow.

nProcessors=1 completion is 1.14min
nProcessors=2 completion is 55 sec
nProcessors=8 completion is 4.52min
nProcessors=16 completion is 9.24min

I assume that the Task is 'heavy', ie it has a lot of data (list of items etc) and some emlp has 600 tasks.

1. How can I ensure that my assumption (Task is heavy) is the answer to this speed issue (how can I check if a Task=5mb of memory?!?! or the list of task is Xmb)

2. Can I improve this code to get better performance?

Thank you for any observation

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!