Upgrade to Pro — share decks privately, control downloads, hide ads and more …

札束でGradleのケツを叩く

Ryo Sakaguchi
November 09, 2016

 札束でGradleのケツを叩く

Android app build speed can be made faster with $$$.

Ryo Sakaguchi

November 09, 2016
Tweet

More Decks by Ryo Sakaguchi

Other Decks in Programming

Transcript

  1. About me. • ࡔޱ ྒ(͔͙ͪ͞Γΐ͏) • Ո۩԰ -> SIer ->

    AndroidΞϓϦΤϯδχΞ • Θ͘Θ͘͞Μͬͯݺ͹Εͯ·͢ • ܲ೑ͱϏʔϧ͕޷͖Ͱ͢ • ࠓ೔ͷओ࠵ऀΛ͍͍͓ͤͯͨͩͯ͞Γ·͢
  2. gradle.propertiesΛฤू͢Δ • org.gradle.daemon=true • σʔϞϯϓϩηεΛ࢖͍·͢ • org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

    • JVMͷҾ਺ʹϝϞϦΛͲΕ͘Β͍·ͰׂΓ౰ͯΔ͔Λ͜͜Ͱࢦఆ͢Δ • org.gradle.parallell=true • ฒྻϞʔυΛ༗ޮԽ • org.gradle.configureondemand=true • େ͖ͳϓϩδΣΫτͳͲͰ༗ޮͳ༷Ͱ͢ɻ gradle.properties 1/3
  3. build.gradleΛฤू͢Δ android { … dexOptions { javaMaxHeapSize “2g” preDexLibraries true

    } productFlavors { lollipop { // multidex؀ڥͰ͸͔ͳΓૣ͘ͳΓ·͢ɻ minSdkVersion 21 } } }
  4. લड़ͷઃఆΛԿ΋͠ͳ͍৔ ߹ͷ݁Ռ͸ͪ͜Β 1. 4 mins 32.036 secs 2. 3 mins

    3.593 secs 3. 3 mins 13.68 secs 4. 2 mins 59.793 secs 5. 2 mins 49.458 secs
  5. ݁Ռ͸ͪ͜Β 1. 3 mins 39.298 secs 2. 1 mins 36.881

    secs 3. 1 mins 33.334 secs 4. 1 mins 38.63 secs 5. 1 mins 36.758 secs
  6. build.gradleΛฤू͢Δ android { … dexOptions { javaMaxHeapSize “32g” preDexLibraries true

    } productFlavors { lollipop { // multidex؀ڥͰ͸͔ͳΓૣ͘ͳΓ·͢ɻ minSdkVersion 21 } } }
  7. લड़ͷઃఆΛԿ΋͠ͳ͍৔ ߹ͷ݁Ռ͸ͪ͜Β 1. 1 mins 7.58 secs 2. 2 mins

    51.058 secs 3. 1 mins 19.977 secs 4. 1 mins 5.356 secs 5. 37.249 secs
  8. ݁Ռ͸ͪ͜Β 1. 1 mins 10.933 secs 2. 20.561 secs 3.

    19.172 secs 4. 20.31 secs 5. 18.745 secs