• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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.
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic