RFR: 8207812: Implement Dynamic CDS Archive
Karen Kinnear
karen.kinnear at oracle.com
Thu Apr 25 16:08:26 UTC 2019
Calvin,
Thank you for checking out this information.
Summary is that running the dynamic archive can be slightly faster than without, which
was the big question. So that is really good news.
I understand that you may have found/fixed a bug and that Claes had an idea
about how to make the startup faster - so I assume you will have better numbers soon.
In the meantime, with applications with more than 2-3 classes, startup has improved,
so overall good news.
I don’t know where/how this new option will be documented - I wanted to make sure
that you set customer expectations here - that this flag is an ease-of-use flag, so
that instead of step 1: create class list, step 2: create archive, step 3: run with archive,
that you can have the first real run create the archive on exit. And the expectation
should be that after the run, the archive creation will take about the same amount of
time it used to. Subsequent runs will be faster since they using the archive.
[detailed questions embedded below]
> On Apr 22, 2019, at 1:06 PM, Calvin Cheung <calvin.cheung at oracle.com> wrote:
>
> Hi Karen,
>
> Thanks for your review!
> Please see my replies in-line below.
>
> On 4/19/19, 9:29 AM, Karen Kinnear wrote:
>>
>> Calvin,
>>
>> Many thanks for all the work getting this ready, significantly enhancing the testing and bug fixes.
>>
>> I marked the CSR as reviewed-by - it looks great!
>>
>> I reviewed this set of changes - I did not review the tests - I assume you can get someone
>> else to do that. I am grateful that Jiangli and Ioi are going to review this also - they are much closer to
>> the details than I am.
>>
>> 1. Do you have any performance numbers?
>> 1a. Startup: does using a combined dynamic CDS archive + base archive give similar startup benefits
>> when you have the same classes in the archives?
> Below are some performance numbers from Eric, each number is for 50 runs:
> (base: using the default CDS archive,
> test: using the dynamic archive,
> Eric will get some numbers with a single archive which I think that's what you're looking for)
>
> Lambda-noop:
> base:
> 0.066441427 seconds time elapsed
> test:
> 0.075428824 seconds time elapsed
>
> Noop:
> base:
> 0.057614537 seconds time elapsed
> test:
> 0.066061557 seconds time elapsed
>
> Netty:
> base:
> 0.827013307 seconds time elapsed
> test:
> 0.604982805 seconds time elapsed
>
> Spring:
> base:
> 2.376707358 seconds time elapsed
> test:
> 1.927618893 seconds time elapsed
>
> The first 2 apps only have 2 to 3 classes in the dynamic archive. So the overhead is likely due to having to open and map the dynamic archive and performs checking on header, etc. For small apps, I think it's better to use a single archive. The Netty app has around 1400 classes in the dynamic archive; the Spring app has about 3700 classes in the dynamic archive.
>
> I also used our LotsOfClasses test to collect some perf numbers. This is more like runtime performance, not startup performance.
>
> With dynamic archive (100 runs each):
> real 2m37.191s
> real 2m36.003s
> Total loaded classes = 24254
> Loaded from base archive = 1186
> Loaded from top archive = 23042
> Loaded from jrt:/ (runtime module) = 26
>
> With single archive (100 runs each):
> real 2m38.346s
> real 2m36.947s
> Total loaded classes = 24254
> Loaded from archive = 24228
> Loaded from jrt:/ (runtime module) = 26
>
>>
>> 1b. Do you have samples of uses of the combined dynamic CDS archive + base archive vs. a single
>> static archive built for an application?
>> - how do the sets of archived classes differ?
> Currently, the default CDS archive contains around 1187 classes. With the -XX:ArchiveClassesAtExit option, if the classes are not found in the default CDS archive, they will be archived in the dynamic archive. The above LotsOfClasses example shows some distributions between various archives.
>> - one note was that the AtExit approach exclude list adds anything that has not yet linked - does that make a significant difference in the number of classes that are archived? Does that make a difference in either startup time or in application execution time? I could see that going either way.
> As the above numbers indicated, there's not much difference in terms of execution time using a dynamic vs a single archive with a large number of classes loaded. The numbers from Netty and Spring apps show an improvement over default CDS archive.
>>
>> 1c. Any sense of performance cost for first run - how much time does it take to create an incremental archive?
>> - is the time comparable to an existing dump for a single archive for the application?
>> - this is an ease-of-use feature - so we are not expecting that to be fast
>> - the point is to set expectations in our documentation
> I did some rough measurements with the LotsOfClasses test with around 15000 classes in the classlist.
>
> Dynamic archive dumping (one run each):
> real 0m19.756s
> real 0m20.241s
>
> Static archive dumping (one run each):
> real 0m17.725s
> real 0m16.993s
What are the two numbers from one run?
>>
>> 2. Footprint
>> With two archives rather than one, is there a significant footprint difference? Obviously this will vary by app and archive.
>> Once again, the point is to set expectations.
> Sizes of the archives for the LotsOfClasses test in 1a.
>
> Single archive: 242962432
> Default CDS archive: 12365824
> Dynamic archive: 197525504
Is this accurate? So the combined sizes are smaller than the single archive?
>
>>
>> 3. Runtime performance
>> With two sets of archived dictionaries & symbolTables - is there any significant performance cost to larger benchmarks, e.g. for class loading lookup for classes that are not in the archives? Or symbol lookup?
> I used the LotsOfClasses test again. This time archiving about half of the classes which will be loaded during runtime.
>
> Dynamic archive (10 runs each):
> real 0m30.214s
> real 0m29.633s
> Loaded classes = 24254
> Loaded from dynamic archive: 13168
Question - is this loaded from both archives? Or just from the dynamic archive so you also loaded
additional classes from the base archive?
>
> Single archive (10 runs each):
> real 0m32.383s
> real 0m32.905s
> Loaded classes = 24254
> Loaded from single archive = 15063
>>
>> 4. Platform support
>> Which platforms is this supported on?
>> Which ones did you test? For example, did you run the tests on Windows?
> I ran the jtreg tests via mach5 on all 4 platforms (Linux, Mac, Solaris, Windows).
Many thanks,
Karen
>
> thanks,
> Calvin
More information about the hotspot-runtime-dev
mailing list