{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/5951","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/5951/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/5951/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/5951/events","html_url":"https://github.com/gradle/gradle/issues/5951","id":340564390,"node_id":"MDU6SXNzdWUzNDA1NjQzOTA=","number":5951,"title":"Performance issues on Java 10 (and higher) on Windows","user":{"login":"cliffred","id":4520409,"node_id":"MDQ6VXNlcjQ1MjA0MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4520409?v=4","gravatar_id":"","url":"https://api.github.com/users/cliffred","html_url":"https://github.com/cliffred","followers_url":"https://api.github.com/users/cliffred/followers","following_url":"https://api.github.com/users/cliffred/following{/other_user}","gists_url":"https://api.github.com/users/cliffred/gists{/gist_id}","starred_url":"https://api.github.com/users/cliffred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cliffred/subscriptions","organizations_url":"https://api.github.com/users/cliffred/orgs","repos_url":"https://api.github.com/users/cliffred/repos","events_url":"https://api.github.com/users/cliffred/events{/privacy}","received_events_url":"https://api.github.com/users/cliffred/received_events","type":"User","site_admin":false},"labels":[{"id":460356696,"node_id":"MDU6TGFiZWw0NjAzNTY2OTY=","url":"https://api.github.com/repos/gradle/gradle/labels/a:chore","name":"a:chore","color":"1d76db","default":false},{"id":478384995,"node_id":"MDU6TGFiZWw0NzgzODQ5OTU=","url":"https://api.github.com/repos/gradle/gradle/labels/from:contributor","name":"from:contributor","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"oehme","id":1191797,"node_id":"MDQ6VXNlcjExOTE3OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1191797?v=4","gravatar_id":"","url":"https://api.github.com/users/oehme","html_url":"https://github.com/oehme","followers_url":"https://api.github.com/users/oehme/followers","following_url":"https://api.github.com/users/oehme/following{/other_user}","gists_url":"https://api.github.com/users/oehme/gists{/gist_id}","starred_url":"https://api.github.com/users/oehme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oehme/subscriptions","organizations_url":"https://api.github.com/users/oehme/orgs","repos_url":"https://api.github.com/users/oehme/repos","events_url":"https://api.github.com/users/oehme/events{/privacy}","received_events_url":"https://api.github.com/users/oehme/received_events","type":"User","site_admin":false},"assignees":[{"login":"oehme","id":1191797,"node_id":"MDQ6VXNlcjExOTE3OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1191797?v=4","gravatar_id":"","url":"https://api.github.com/users/oehme","html_url":"https://github.com/oehme","followers_url":"https://api.github.com/users/oehme/followers","following_url":"https://api.github.com/users/oehme/following{/other_user}","gists_url":"https://api.github.com/users/oehme/gists{/gist_id}","starred_url":"https://api.github.com/users/oehme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oehme/subscriptions","organizations_url":"https://api.github.com/users/oehme/orgs","repos_url":"https://api.github.com/users/oehme/repos","events_url":"https://api.github.com/users/oehme/events{/privacy}","received_events_url":"https://api.github.com/users/oehme/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gradle/gradle/milestones/73","html_url":"https://github.com/gradle/gradle/milestone/73","labels_url":"https://api.github.com/repos/gradle/gradle/milestones/73/labels","id":3382823,"node_id":"MDk6TWlsZXN0b25lMzM4MjgyMw==","number":73,"title":"4.10 RC1","description":"","creator":{"login":"oehme","id":1191797,"node_id":"MDQ6VXNlcjExOTE3OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1191797?v=4","gravatar_id":"","url":"https://api.github.com/users/oehme","html_url":"https://github.com/oehme","followers_url":"https://api.github.com/users/oehme/followers","following_url":"https://api.github.com/users/oehme/following{/other_user}","gists_url":"https://api.github.com/users/oehme/gists{/gist_id}","starred_url":"https://api.github.com/users/oehme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oehme/subscriptions","organizations_url":"https://api.github.com/users/oehme/orgs","repos_url":"https://api.github.com/users/oehme/repos","events_url":"https://api.github.com/users/oehme/events{/privacy}","received_events_url":"https://api.github.com/users/oehme/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":52,"state":"open","created_at":"2018-05-29T07:35:56Z","updated_at":"2018-07-12T10:33:23Z","due_on":"2018-08-13T07:00:00Z","closed_at":null},"comments":2,"created_at":"2018-07-12T09:43:44Z","updated_at":"2018-07-12T11:19:18Z","closed_at":null,"author_association":"NONE","body":"After we upgraded to Java 10 we noticed the duration of the configuration phase of our build increased dramatically. \r\n\r\n### Expected Behavior\r\nNo significant changes in build time after upgrading to Java 10.\r\n\r\n### Current Behavior and context\r\nWe have a large multi-project build with 197 sub projects. Benchmarking with the [gradle-profiler ](https://github.com/gradle/gradle-profiler) showed that executing `gradle help` took 6.4 seconds on average on Java 9 and 47.4 seconds on Java 10. We measured `gradle help` to focus on the configuration phase.\r\n\r\nProfiling with JProfiler revealed this increase was due to an increased average time of the `File.listRoots()` method, which gets called from [org.gradle.api.internal.file.FileOrUriNotationConverter.convert(Object,NotationConvertResult)](https://github.com/gradle/gradle/blob/8c61b05f79ac58fac3f41f3245a97275ad3b5837/subprojects/core/src/main/java/org/gradle/api/internal/file/FileOrUriNotationConverter.java#L101). The average time of `File.listRoots()`  went from 4μs on Java 9, to 6,065μs on Java 10. In our build this method gets called 6220 times, resulting in the dramatic increase.\r\n\r\nThe performance decrease of `File.listRoots()` in Java 10 is probably due to this change in `java.io.WinNTFileSystem`: http://hg.openjdk.java.net/jdk10/jdk10/jdk/rev/9065d9d6c3e0\r\n\r\nAs [org.gradle.api.internal.file.FileOrUriNotationConverter.convert(Object,NotationConvertResult)](https://github.com/gradle/gradle/blob/8c61b05f79ac58fac3f41f3245a97275ad3b5837/subprojects/core/src/main/java/org/gradle/api/internal/file/FileOrUriNotationConverter.java#L101) gets called (relatively) often in Gradle builds, it might be a good idea to cache the result of `File.listRoots()` .\r\n\r\nAs a workaround we prefixed a lot of file references with `file:` and replaced `file('path')` with `new File('path')`, preventing calls to `File.listRoots()`. This improved the build time significantly (17.3 seconds on average), but still a lot slower than with Java 9, because this method also gets called a lot with arguments that are not in our control, like 'gradle/dependency-locks', 'build', 'src/main/java', and 'src/test/java'.\r\n\r\n### Steps to Reproduce\r\nInstall JDK 10 and set JAVA_HOME to the JDK 10 location and run your build. Especially noticeable with large projects with many file references in the build files.\r\n\r\n### Your Environment\r\nGradle 4.8\r\nWindows 10\r\nCore i7-4790\r\n32GB RAM"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/404478783","html_url":"https://github.com/gradle/gradle/issues/5951#issuecomment-404478783","issue_url":"https://api.github.com/repos/gradle/gradle/issues/5951","id":404478783,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDQ3ODc4Mw==","user":{"login":"cliffred","id":4520409,"node_id":"MDQ6VXNlcjQ1MjA0MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4520409?v=4","gravatar_id":"","url":"https://api.github.com/users/cliffred","html_url":"https://github.com/cliffred","followers_url":"https://api.github.com/users/cliffred/followers","following_url":"https://api.github.com/users/cliffred/following{/other_user}","gists_url":"https://api.github.com/users/cliffred/gists{/gist_id}","starred_url":"https://api.github.com/users/cliffred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cliffred/subscriptions","organizations_url":"https://api.github.com/users/cliffred/orgs","repos_url":"https://api.github.com/users/cliffred/repos","events_url":"https://api.github.com/users/cliffred/events{/privacy}","received_events_url":"https://api.github.com/users/cliffred/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T11:19:18Z","updated_at":"2018-07-12T11:19:18Z","author_association":"NONE","body":"Thank you for the quick reply. I've just emailed you the JFR file."}}
{"actor":{"display_login":"cliffred"}}