NoWar
NoWar

Reputation: 37633

How to improve performance of WPF application with multiple background workers

I have some WPF application which downloads files via Background Worker and at the same time shows some animations.

The main problem that in that moment animation gets stuck periodically.

I have no idea why. But I guess that I have to put down priority of that Background Worker which downloads files.

Any clue how is better merge animation and file downloading under WPF application?

Surely I can always devide this functionality but the idea is to keep all-in-one bottle. :)

Any good performance approaches?

Thank you folk!

Upvotes: 0

Views: 449

Answers (1)

Emond
Emond

Reputation: 50672

My guess is that the 9 BackgroundWorkers are queuing up for the UI thread to report progress.

Solutions:

  • less backgroundworkers - 9 is a lot of connections to the server, perhaps you could try to load more data in one call.
  • less progress reporting - If the UI thread is the bottleneck you could have the backgroundworkers each set a property and have one backgroundworker report all the progress.
  • less animations - will free the UI thread too.

Upvotes: 2

Related Questions