Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

First of all, Chapter 11 - Improving Remoting Performance looks promising. If not, maybe remoting performance and inner workings of MarshalByRefObject will help.

Next, a few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization? how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

First of all, Chapter 11 - Improving Remoting Performance looks promising. If not, maybe remoting performance and inner workings of MarshalByRefObject will help.

Next, a few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

First of all, Chapter 11 - Improving Remoting Performance looks promising. If not, maybe remoting performance and inner workings of MarshalByRefObject will help.

Next, a few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

a few links
Source Link
Pat
  • 318
  • 1
  • 8

AFirst of all, Chapter 11 - Improving Remoting Performance looks promising. If not, maybe remoting performance and inner workings of MarshalByRefObject will help.

Next, a few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

A few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

First of all, Chapter 11 - Improving Remoting Performance looks promising. If not, maybe remoting performance and inner workings of MarshalByRefObject will help.

Next, a few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

Source Link
Pat
  • 318
  • 1
  • 8

A few observations/questions/ideas:

  1. Why iterate through and Unsubscribe for each topic? Just clear the dictionary and be done with it.
  2. You can initialize a queue with an IEnumerable, so don't iterate to enqueue items (especially because your code doesn't care in what order things are done).
  3. Throwing exceptions is very expensive - is that happening in the remote case? In fact, Remove should only throw if the argument is null, and you're already checking for that, so try just removing the try/catch.
  4. As mentioned before, your code doesn't care about the order of operations, which means that it is a perfect candidate for parallel processing. Why not use a ConcurrentDictionary or similar data structure and do the operations in parallel?
  5. Why are you using MarshalByRef? Do you know how expensive is MarshalByRefObject compared to serialization?

None of these specifically address why the remote call is slow, but you should be able to try them and see if perf improves.

lang-cs

AltStyle によって変換されたページ (->オリジナル) /