1
1944USA
I am re-architecting a C# application written as a multithreaded
Windows Service and trying to squeeze every bit of performance out of
it.
1) Does the thread that an object is instantiated on have any impact on
its performnce?
Example: if I instantiate object "X" on thread "A" pass a reference
of "X" to Thread "B" and then have "B" run "X" (Exclusively). Does
this impact performance as compared to Thread "B" instantiating object
"X" itself?
2) In the above example would it matter if object "X" was using
Interop?
I'm asking the above questions because we currently have a group of
objects instantiated on thread "A" and then when one of the
"Calculation worker threads" > "B","C","D" etc.. need a particular
object, Thread "A" provides them a reference for there exclusive use.
All the objects contain a reference to a COM object through interop
(not sure if the use of Interop has any impact).
I'm running this on an 8 CPU Windows 2003 Server.
As I add "Calculation worker threads" Throughput Performance increases
up to about 3 Threads after that performance actually starts to
decrease. I'm surprised that on an 8 CPU Server that the "tipping
point" is so low. The "Calculation worker threads" are very
mathematically intensive, is it possible there is "blocking" going on
within the .NET Runtime or Interop? I'm trying to pinpoint the bottle
neck. (There is no IO in the Calculation Threads)
Thanks In Advance!!!
Windows Service and trying to squeeze every bit of performance out of
it.
1) Does the thread that an object is instantiated on have any impact on
its performnce?
Example: if I instantiate object "X" on thread "A" pass a reference
of "X" to Thread "B" and then have "B" run "X" (Exclusively). Does
this impact performance as compared to Thread "B" instantiating object
"X" itself?
2) In the above example would it matter if object "X" was using
Interop?
I'm asking the above questions because we currently have a group of
objects instantiated on thread "A" and then when one of the
"Calculation worker threads" > "B","C","D" etc.. need a particular
object, Thread "A" provides them a reference for there exclusive use.
All the objects contain a reference to a COM object through interop
(not sure if the use of Interop has any impact).
I'm running this on an 8 CPU Windows 2003 Server.
As I add "Calculation worker threads" Throughput Performance increases
up to about 3 Threads after that performance actually starts to
decrease. I'm surprised that on an 8 CPU Server that the "tipping
point" is so low. The "Calculation worker threads" are very
mathematically intensive, is it possible there is "blocking" going on
within the .NET Runtime or Interop? I'm trying to pinpoint the bottle
neck. (There is no IO in the Calculation Threads)
Thanks In Advance!!!