Java Performance Tuning

Java(TM) - see bottom of page

|home |services |training |newsletter |tuning tips |tool reports |articles |resources |about us |site map |contact us |
Tools: | GC log analysers| Multi-tenancy tools| Books| SizeOf| Thread analysers|

Our valued sponsors who help make this site possible
ManageEngine's Site24x7: End-to-End analysis on Java EE web transactions. Sign up for FREE! 

AppDynamics: Get complete browser to backend visibility. Monitor Now! 

New Relic: Try free w/ production profiling and get a free shirt! 

Question of the month: Profiling Applets

Use jKool analytics as a service
Spot patterns in time-series data - real-time and free

JProfiler
Get rid of your performance problems and memory leaks!

Chart Java Jitter with jHiccup
Monitor and identify pauses in your Java apps. Download now


Java Performance Training Courses
COURSES AVAILABLE NOW. We can provide training courses to handle all your Java performance needs

See Your Message Here
You could have your tool advertised here, to be seen by thousands of potential customers

Java Performance Tuning, 2nd ed
The classic and most comprehensive book on tuning Java

Java Performance Tuning Newsletter
Your source of Java performance news. Subscribe now!
Enter email:


ManageEngine
ManageEngine's Site24x7: End-to-End analysis on Java EE web transactions. Sign up for FREE!

AppDynamics
AppDynamics: Get complete browser to backend visibility. Monitor Now!

New Relic
New Relic: Try free w/ production profiling and get a free shirt!


Use jKool analytics as a service
Spot patterns in time-series data - real-time and free

JProfiler
Get rid of your performance problems and memory leaks!

Chart Java Jitter with jHiccup
Monitor and identify pauses in your Java apps. Download now


Back to newsletter 041 contents

There are several ways to profile an applet.

  1. Manually stick timing code into the various method calls and find out where the time is going by analyzing that data (output according to some scheme of your own). This is not recommended unless none of the other ways can be made to work.
  2. Run using the appletviewer (should be in your JDK "bin" directory), passing any profiler parameters using the -J parameter, for example appletviewer -J-Xrunhprof:cpu=samples myappletpage.html or appletviewer -J-Xprof myappletpage.html.
  3. Run the applet in a normal JVM using the Sun appletviewer class (sun.applet.AppletViewer), and using whatever profiler you want operating as normal for any JVM. For example java -Xrunhprof:cpu=samples sun.applet.AppletViewer myappletpage.html or java -Xprof sun.applet.AppletViewer myappletpage.html.
  4. Run the applet in your preferred browser and figure out how to connect your preferred profiler to the Java plug-in or embedded JVM. This last seems to be difficult to do, and only some profilers will work with some browsers. You need to check with your profiler vendor to figure out how to do this, though it may be a FAQ so there could be a simple set of instructions to follow.

Beyond the technicalities, there is nothing special about profiling applets: the code needs to be optimized in the same way any Java program would be optimized. There are a couple of extra concerns to do with applet download and startup time, which means that you want to have the applet and all support resources in a compressed jar file. Although even better is to have the applet start up with almost no resources and minimal class file content, i.e. as fast as possible, then for it to download all further resources it needs while keeping the user occupied or entertained.

The JavaPerformanceTuning.com team


Back to newsletter 041 contents


Last Updated: 2014-11-02
Copyright © 2000-2014 Fasterj.com. All Rights Reserved.
All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. JavaPerformanceTuning.com is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
URL: http://www.JavaPerformanceTuning.com/news/qotm041.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us