Win a copy of Head First Android this week in the Android forum!
  • 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

JSP load time performance if there are lot of JS coding

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is Adding javascript coding inside JSP file will degrade the performance(consider there are 200-300 lines of code for javscript) of the JSP. If so is moving the javscript coding to separate script file and including the script file in JSP will boost peformance? Suggest me other options too.What is the best practice in such case?
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Definitely Adding javascript coding inside JSP file will degrade the performance. That is what is you requirement of application. It may be possible some JS need before page load or some need after JSP page load.

So Do just one thing make list Which JS need before page load and need JS after page load. Now JS which need after JSP page load put just before
HTML </body> BODY tag close.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nishan Patel wrote:Yes, Definitely Adding javascript coding inside JSP file will degrade the performance.


Poppycock! A few hundred lines of JavaScript is nothing. What matters is what that script does. If it puts the browser into an infinite loop, they yeah, there'll be issues.

But the mere presence of a small amount of script in a JSP will have no measurable effect on performance.

That said, putting the script into a separate script file will allow the script to be cached, and is a good idea. This is especially important in client-intensive applications where the amount of script can be considerably larger than a few hundred lines.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic