RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Magnus Ihse Bursie
We should use CDS to minimize Java startup time during build. We run multiple Java commands, and every second counts. On my machine, I get a ~3% build time speedup with this fix. Bug: https://bugs.openjdk.java.net/browse/JDK-8188312 WebRev: http://cr.openjdk.java.net/~ihse/JDK-8188312-use-CDS-

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread David Holmes
Hi Magnus, As I just put in the bug report, it isn't quite this simple. You have to be able to tolerate/recover from failure to map the shared archive. Cheers, David On 3/10/2017 8:24 PM, Magnus Ihse Bursie wrote: We should use CDS to minimize Java startup time during build. We run multiple

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Claes Redestad
Hi, -Xshare:auto silently ignores failures to map the shared archive and should be safe to use. I think you're thinking of -Xshare:on which will fail/abort the VM if mapping fails. /Claes On 2017-10-03 12:28, David Holmes wrote: Hi Magnus, As I just put in the bug report, it isn't quite t

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread David Holmes
Hi Claes, On 3/10/2017 8:48 PM, Claes Redestad wrote: Hi, -Xshare:auto silently ignores failures to map the shared archive and should be safe to use. I think you're thinking of -Xshare:on which will fail/abort the VM if mapping fails. Ah okay. In that case seems reasonable. But please test

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread David Holmes
Erik J. raises a good point in the bug report that -XX:SharedArchiveFile=xxx should be used if we create the archive. The build system has no business creating an archive inside the boot JDK. David On 3/10/2017 9:02 PM, David Holmes wrote: Hi Claes, On 3/10/2017 8:48 PM, Claes Redestad wrote

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Magnus Ihse Bursie
On 2017-10-03 14:21, David Holmes wrote: Erik J. raises a good point in the bug report that -XX:SharedArchiveFile=xxx should be used if we create the archive. The build system has no business creating an archive inside the boot JDK. Agree, that is a better solution. I was not aware of the -XX

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread David Holmes
Looks good to me. Thanks, David On 3/10/2017 10:47 PM, Magnus Ihse Bursie wrote: On 2017-10-03 14:21, David Holmes wrote: Erik J. raises a good point in the bug report that -XX:SharedArchiveFile=xxx should be used if we create the archive. The build system has no business creating an archive

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Erik Joelsson
The change looks good, but unfortunately I don't see a lot of gain. First of all it seems the -XX:SharedArchiveFile option removes a lot of the performance gain. Here are some rough numbers from my machine. All of them are "time make images" with a clean build directory, on a 16 core/32 threads

Building OpenJDK9 on MSYS2

2017-10-03 Thread Peter Budai
Hello, According to http://hg.openjdk.java.net/jdk9/jdk9/file/a08cbfc0e4ec/common/doc/building.html “msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require a community effort to implement” I’d like to help making the

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread David Holmes
Hi Erik, You might need to verify that CDS was actually used - the -Xshare:auto will hide failures. Switch to -Xshare:on to see if it actually works. I haven't tried measuring anything. David On 4/10/2017 12:45 AM, Erik Joelsson wrote: The change looks good, but unfortunately I don't see a l

Re: Building OpenJDK9 on MSYS2

2017-10-03 Thread Magnus Ihse Bursie
I gave msys2 a shot some time ago, but it ended up too much trouble. I'll share some of my notes from that attempt, for what it's worth. To install package X/Y, run "pacman -S X/Y". Missing tools and packages where to find them: cmp: msys/diffutils tar: msys/tar make: msys/make unzip: msys/unz

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Magnus Ihse Bursie
It might be the case that we should not really continue with this as long as we have JDK 8 as default boot jdk. If so, we should at least add a -Xshare:auto, which will allow the user to manually add a system-wide CDS archive to their boot jdk, and benefit from it. And then we'll revisit thi

Re: Building OpenJDK9 on MSYS2

2017-10-03 Thread Magnus Ihse Bursie
Actually, it wasn't so much remaining trouble. :-) I fired up msys2 and checked out where I left off. It turned out that the remaining snag was that msys2 tries to convert command lines automatically, from "unix" style paths to "windows" style paths. Unfortunately, it does not do this very well

Re: RFR: JDK-8188312 Use CDS if present when running the Boot JDK during build

2017-10-03 Thread Ioi Lam
If you use SharedArchiveFile, you should set -XX:-VerifySharedSpaces at the same time. Long story short -- for security, we don't want bad archives to be mapped into the JVM. If you don't specify SharedArchiveFile, the archive is loaded form the JDK installation directory, and we trust that