• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Block of code taking too much time on Server

 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a loop that iterates 28000 times, when i deploy it to server, it takes around 1.5 minutes to execute. When i am running it locally on my machine, it only takes 2 seconds. I tried everything but it is still taking time.

 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ujjwal soni wrote:Hi,

I have a loop that iterates 28000 times, when i deploy it to server, it takes around 1.5 minutes to execute. When i am running it locally on my machine, it only takes 2 seconds. I tried everything but it is still taking time.



My server has more resources than my local machine so memory and space is almost thrice than my local machine has
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a million reasons code can run slow on a given machine.  For example, your server may have more resources than your local machine, but if the server is past its prime, has a lot of processes running or is configured poorly, those resources will not do you any good.  Once I had an application that ran more slowly on the server than my local machine.  I had to provide hard data in the form of JAMon (for the application) and Decapo (for the physical platform) benchmarks comparing my laptop against the server before our administrators would take me seriously.  We moved the app to more current hardware and the performance "problem" went away.  
Our Enterprise Performance FAQ has links to JAMon and Decapo, as well as other Best Practices regarding performance.  I'm also going to move this topic to the Performance forum since it isn't really a Struts issue.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic