On 09/19/2013 10:00 AM, Michael Simacek wrote:
Hi,
I thought about improving performance of the default doclet implementation a
bit.
According to profiler results, most of the CPU time is spent in constructing
the member map in VisibleMemberMap.java.
So I've rewritten part of the VisbleMemberMap and reduced the javadoc run time
to 60-70% of original run time (on large inputs).
Is there any chance of this patch (attached) being accepted into OpenJDK?
I've never made any contribution to OpenJDK before, so I would like to ask for
code review and guidance through the contribution process.
Michael
Michael,
Just from the description, this sounds interesting.
There are two criteria for a change like this:
-- the obvious one -- do all the javadoc regression tests pass. These
are the tests
langtools/test/com/sun/javadoc
langtools/test/tools/javadoc
-- does the change affect the generated docs. Unfortunately, you cannot
trivially use comparison tools (like diff) to compare the output,
because of various date stamps within the generated docs. Changing the
makefiles to disable the date stamps is not a solution either, because
of timestamps in other artifacts generated during the build (corba
files.) My personal solution is to use a script (attached) to scrub
time and date stamps from generated docs. Run this script on a
directory such as the generated docs directory and it will remove any
timestamp info using "sed --in-place". Once you have done that you
can use tools like diff and meld to compare the generated docs before
and after applying your patch.
-- Jon
#!/bin/sh
# Remove timestamps from html files generated by javadoc.
# This includes timestamps generated by javadoc itself,
# and timestamps propogated from the javadoc comments.
for file in $(find $1 -name \*.html | xargs -n 1 grep --files-with-matches
"Generated by javadoc" ) ; do
sed --in-place \
-e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
-e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \
-e
's/\(Monday\|Tuesday\|Wednesday\|Thursday\|Friday\|Saturday\|Sunday\),
[A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* \(AM\|PM\) PDT/(removed)/' \
$file
done