gradle 2.9가 2.8에 비해서 성능이 많아 좋아졌다고 해서 발표했다. 메모리를 적게 사용하고 증분 빌드 방식을 사용하여 엄청 빠르게 했다고 얘기했다.


실제로 2.7과 2.9 버전간의 테스트한 결과이다. 10.8초에서 4.4초로 50%이상 확 줄어들었다!!!! 헉~


<2.7>

$ gradle clean compileScala

Starting a new Gradle Daemon for this build (subsequent builds will be faster).

:clean

:compileJava UP-TO-DATE

:compileScala


BUILD SUCCESSFUL


Total time: 10.809 secs




<2.9>

$ gradle clean compileScala

:clean

:compileJava UP-TO-DATE

:compileScala


BUILD SUCCESSFUL


Total time: 4.456 secs





참조

https://docs.gradle.org/current/release-notes



Performance improvements for incremental builds

In many cases, Gradle 2.9 is much faster than Gradle 2.8 when performing incremental builds.

Very large builds (many thousands of source files) could see incremental build speeds up to 80% faster than 2.7 and up to 40% faster than 2.8.

Faster up-to-date checking for incremental builds

Gradle now uses a more efficient mechanism to scan the filesystem, making up-to-date checks significantly faster. This improvement is only available when running Gradle with Java 7 or newer.

Other improvements have been made to speed-up include and exclude pattern evaluation; these improvements apply to all supported Java versions.

No build script changes are needed to take advantage of these performance optimizations.

Reduced memory footprint for incremental builds

Gradle now uses much less memory than previous releases when performing incremental builds. By de-duplicating Strings used as file paths in internal caches, and by reducing the overhead of listing classes under test for Java projects, some builds use 30-70% less memory that Gradle 2.8.

Reduced memory consumption can translate into significant performance improvements when a build process is running low on memory.

No build script changes are needed to take advantage of these memory savings.





어떻게 한 것인지 자세한 내용을 보려면 다음을 참조한다. 아주 잘 나와 있다. (좀 봐야할듯.)


https://github.com/gradle/gradle/blob/master/design-docs/incremental-build.md


java.nio.file.Files.walkFileTree을 이용해서 메타 정보를 수집해서 다시 파일을 읽지 않도록 했다고 적혀 있고, Guava의 Interners.newWeakInterner()를 이용하여 메모리 최적화할 수 있게 했다.

Posted by '김용환'
,