Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
2.50/5 (4 votes)
Hi,
I developed a multi-threaded program in C# .NET which brings data from web. The problem I'm going through is that its only running fast on my computer and runs slow even on the machine with higher hardware specifications.
And the difference in speeds is very huge.
On my pc it hits 4000 urls per minute whereas on other it go maximum upto 600 urls.

I have used .NET 4.5. Any idea what can be the problem.
Posted
Comments
SoMad 13-Apr-14 20:42pm    
In addition to the suggestions in the 3 solutions, it is also possible a firewall and/or anti-virus package is slowing performance on the other system.

Soren Madsen

It's difficult to exactly pin-point from here, but here are some ideas.

You should add some instrumentation, performance counters[^] to see where the bottleneck is.

It's not necessarily the machine hardware and could be that the other machine just take loner to process the data from urls (i.e. network speed).
 
Share this answer
 
Comments
S.Faizan.Ali 13-Apr-14 15:23pm    
Thanks for the reply. The computer on which its running fast have following specs
4GB RAM
Core i5 2.4 GHZ
with 4mb of internet
Whereas the other computer has
64 GB of RAM
Core i7
with 25 MB of internet
1.The multi-threading application depends first on the number of CPUs existing on the computer, then on the CPU speed and the available RAM.

2.Because in each thread your are accessing URL from internet, the internet speed of your testing PC is also very important.

3.You should use an optimum number of threads (not no many threads) and to release the used resources as soon as possible.
 
Share this answer
 
Comments
S.Faizan.Ali 13-Apr-14 15:28pm    
Thanks for the reply. The computer on which its running fast have following specs
4GB RAM
Core i5 2.4 GHZ
with 4mb of internet
Whereas the other computer has
64 GB of RAM
Core i7
with 25 MB of internet.
If the problem is in my code so why its fast on my computer. I am completely blank whats going on?
Raul Iloc 14-Apr-14 1:38am    
From your info is clear that the second computer is better, so maybe this 2nd computer has a very slow internet and/or network speed, or maybe there are also other applications that are using the 2nd computer resources, so you should inspect its running processes into Tasks Manager" or other inspection tool.
Which versions of Windows are you running on each PC?

I recently had a performance issue where 2 PCs with EXACT same HW specifications ran a highly parallel .NET application at drastically different speeds.

The "fast" PC was running Windows 7.
The "slow" PC was running Windows Server 2012.

The Windows Server 2012 PC would never get CPU utilization over 30% for the application run while the Windows 7 PC would run the application with 85-90% CPU utilization. So the Windows Server 2012 would take 2.5 hours to run what the Windows 7 PC did in ~1 hour.

The PROBLEM with the Windows Server 2012 PC was that it had "Balanced" Power Options set.
Once this was set to "Performance" option it ran as fast as the Windows 7 PC. This setting doesn't seem to make a difference on Windows 7 though.

This fixed it here:
http://support.microsoft.com/kb/2207548[^]
 
Share this answer
 
Machine specs have little to nothing to do with this problem. A bigger driver is how your code is written, which you don't provide any to help diagnose the problem. Another is network speed and saturation on a shared connection.
 
Share this answer
 
Run a debug version of this program on a other pc?
 
Share this answer
 
Hi,

Few assumptions:

1. Firewall or Proxy may slow down your process.
2. What you do after hitting the URL
2.1 You may insert some data at DB in this case you are doing it in Test DB and when you deployed you are hitting live DB so it may be the cause ( Live DB is bigger that Test DB )
3. Your sever may fill of other process which consume Web Resource as well as Process.
4. Geographical location also may play the role.


Thanks
Suvabrata
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900