Enhancing Java Performance with Next Generation Application Profiling - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Enhancing Java Performance with Next Generation Application Profiling

Description:

Profiling is measuring an application, specifically: where is the time ... Memory usage is not only shown post-mortem, but interactively, as the app is running ... – PowerPoint PPT presentation

Number of Views:83
Avg rating:3.0/5.0
Slides: 19
Provided by: ethan6
Category:

less

Transcript and Presenter's Notes

Title: Enhancing Java Performance with Next Generation Application Profiling


1
Enhancing Java Performance with Next Generation
Application Profiling
  • Ethan Henry
  • KL Group
  • April 23, 1998

2
What is Profiling?
  • Profiling is measuring an application,
    specifically
  • where is the time being spent?
  • This is classical profiling
  • which method takes the most time?
  • which method is called the most?
  • how is memory being used?
  • what kind of objects are being created?
  • this in especially applicable in OO, GCed
    environments

3
Profiling vs Benchmarking
  • Profiling is measuring statistics on your
    particular application
  • Benchmarking is measuring the performance of a
    particular platform
  • Also, optimization is an automatic technique that
    applies generic enhancements to speed up code

4
Profiling vs Benchmarking
  • A profiler is not designed to tell you what VM is
    the fastest but where you application bottlenecks
    are
  • Faster VMs and optimized code wont make all
    performance problems disappear

5
Why Profile?
  • So, why use a profiler?
  • Intuition is often wrong
  • Performance is a major aspect of program
    acceptance
  • Profiler advantages
  • Accuracy
  • Completeness
  • Solid, statistical information

6
What Profiling Tells You
  • Basic information
  • How much time is spent in each method? (flat
    profiling)
  • How many objects of each type are allocated?

7
What Profiling Tells You
  • Beyond the basics
  • Program flow (hierarchical profiling)
  • do calls to method A cause method B to take too
    much time?
  • Per-line information
  • which line(s) in a given method are the most
    expensive?
  • Which methods created which objects?
  • Visualization aspects
  • Is it easy to use the profiler to get to the
    information youre interested in?

8
How Profilers Work
  • There are a variety of ways that profilers work
  • There is usually a trade-off in terms of
  • accuracy
  • speed
  • granularity of information
  • intrusiveness

9
Insertion
  • One technique is insertion
  • Multiple flavours
  • Source code insertion
  • profiling code goes in with the source
  • easy to do
  • Object code insertion
  • profiling code goes into the .o (C) or .class
    (Java) files
  • hard to do

10
Insertion Pros Cons
  • Insertion Pros
  • can be used across a variety of platforms
  • accurate (in some ways)
  • Insertion Cons
  • requires recompilation or relinking of the app
  • profiling code may affect performance
  • difficult to calculate exact impact

11
Sampling
  • In sampling, the processor or VM is monitored and
    at regular intervals an interrupt executes and
    saves a snapshot of the processor state
  • This data is then compared with the programs
    layout in memory to get an idea of where the
    program was at each sample

12
Sampling Pros Cons
  • Sampling Pros
  • no modification of app is necessary
  • Sampling Cons
  • a definite time/accuracy trade-off
  • a high sample rate is accurate, but takes a lot
    of time
  • more

13
Sampling Pros Cons
  • Sampling Cons
  • very small methods will almost always be missed
  • if a small method is called frequently and you
    have are unlucky, small but expensive methods may
    never show up
  • sampling cannot monitor memory usage

14
Instrumented VM
  • Another way to collect information is to
    instrument the Java VM
  • Using this technique each and every VM
    instruction can be monitored
  • highly accurate

15
Instrumented VM ProsCons
  • Pros
  • The most accurate technique
  • Can monitor memory usage data as well as time
    data
  • Can easily be extended to allow remote profiling
  • Cons
  • The instrumented VM is platform-specific

16
JProbe Profiler
  • JProbe Profiler uses an instrumented VM
  • the VM is the standard Java VM, licensed from
    JavaSoft
  • JProbe is accurate to the nanosecond level
  • using the Pentium clock cycle timer

17
JProbe Profiler
  • JProbe Profiler shows not only timer performance
    data, but also memory usage
  • Memory usage is not only shown post-mortem, but
    interactively, as the app is running

18
JProbe Demo
  • Time for a demo...
Write a Comment
User Comments (0)
About PowerShow.com