COMP 303 (Fall 2006) Assignment 1 Please submit an electronic
version of your assignment as a single PDF file using
WebCT. Include your name and
student ID. This assignment will be marked out of 20. It is your
responsibility to hand this assignment in on time. Assignments not
submitted on time will not be marked and will receive a grade of 0.
By submitting your assignment you acknowledge your understanding of McGill University's academic
integrity policy. Assignments should be done individually.
Due Date: 21 November 11:59pm.
To familiarize yourself with profiling technology and to start
experimenting with AspectJ.
Your mission, if you choose to accept it (you should), will be to
examine what happens when you save a file buffer in jEdit. First you
will do this with the hprof profiler bundled with Java, and then using
a profiler that you write using AspectJ.
- Download and import jEdit
in an Eclipse project.
- Make sure you can compile and run jEdit.
- Download and install AspectJ using the simple
instructions you will find at the other end of the link.
- Run jEdit with the hprof profiler and the option
-agentlib:hprof=cpu=times (experiment with other options)
- Study the output and answer the following questions:
- What are the 5 methods of jEdit that use the most CPU time?
- What are the 5 methods of jEdit that are called the
- Is there any correlation between the two?
- Can you determine anything about the behavior of jEdit
associated with file saving from the hprof output? How? Be
specific and use examples.
- How does the trace information help you understand the behavior of
the program associated with the 10 methods described above? Be
specific and refer to the trace numbers.
- Using AspectJ, make your jEdit project an AspectJ project and write an aspect that will help you profile
specifically the behavior of the program related to the saving of files.
- Write a short paragraph contrasting your experience with hprof and
AspectJ, respectively. Your discussion should include the ease of use
of the profiling technology and the usefulness of the results.
Experiment with sample and heap profiling in hprof. Provide the JVM
arguments you used, your output file, and a short paragraph
synthesizing your experience, and in particular the contrast between
time and sample profiling. Be specific and refer to specific lines in
the output. Maximum two bonus points based on the quality of the
Stuff to Hand In
- The output file obtained from step 4.
- Answers to the questions in step 5.
- The code of your aspect for step 6.
- The answer to the question in step 7.
- (Optional) The results of the optional problem.