Search code examples
c#performanceexecutionmultiplatform

C# program works faster on slower PC and vice versa


I have an OCR program, written with C# (WinForms app). So it's main purpose is to crop, modify, compare, ocr images.. no more or less. When I run this program on slower machine - I'm getting better results!

My main machine (stationary PC):

  • Windows 7 X64
  • AMD64 5000+ X2 processor
  • Samsung HD502IJ 500GB 7200 RPM 16MB Cache SATA hard drive
  • 4GB of DDR2 RAM
  • 9600GT GF video card

notebook's config (benq joybook P52)

  • OS: WinXP x86 SP3
  • slower AMD turion 64 X2 1.6Ghz
  • slower 80 GB 5400RPM sata drive
  • 4x less ram: just 1 GB of DDR2 266Hz
  • 100x slower graphics: integrated ATI X1600 (I don't think that graphic card really matters in this test)
  • I can hardly even surf the net with 8 chrome tabs opened

Can you guess what's faster?

  • Win7 execution time: 600-700+ms
  • WinXP exec. time: 450-500ms

So the question is - how will you explain this abnormal performance? Is it possible to increase performace on my main PC?

P.S.: I know it's hard to say without looking at the code.. sorry about that


Solution

  • OCR is non-trivial code. The most logical first step is to measure! Profile the performance against the exact same test data in both environments. That should give you an idea of which pieces of code are taking the longest on the "faster" machine.