$30 off During Our Annual Pro Sale. View Details »

Optimize Flutter Workflow on Bitrise

Optimize Flutter Workflow on Bitrise

Flutter Meetup Tokyo #8"でのLT資料です。
https://flutter-jp.connpass.com/event/121387/

Hiroki Matsue

March 26, 2019
Tweet

More Decks by Hiroki Matsue

Other Decks in Technology

Transcript

  1. Optimize Flutter Workflow on
    Bitrise
    Hiroki Matsue (@macs_6)
    Mar 26th, 2019
    Flutter Meetup Tokyo #8

    View Slide

  2. This talk is about
    CI steps time reduction

    View Slide

  3. Target Listeners

    View Slide

  4. Who know this

    View Slide

  5. Faster CI makes devs
    happier

    View Slide

  6. Reulst on my project
    Timeout => 9 minutes
    Just few minutes, but Free plan is not so bad ¯\(π)/¯

    View Slide

  7. Flutter CI steps
    1. Install Flutter
    2. Execute "flutter analyze"
    3. Execute "flutter test"
    4. Execute "flutter build" (Android and iOS both)

    View Slide

  8. (Each results were measured with
    my personal project)

    View Slide

  9. Try "Flutter Install"
    step optimization

    View Slide

  10. TL;DR: Just wait new Hybrid stack
    https://discuss.bitrise.io/t/making-flutter-builds-faster/3976/8

    View Slide

  11. What if we cache Flutter?
    • flutter installation: 137sec 㱺 2sec (-135sec)
    • cache-pull: 11sec 㱺 27sec (+16sec)
    • cache-push: 92sec 㱺 209sec (+117sec)
    Only remote storage was changed, no time reduction

    View Slide

  12. Try "flutter build"
    step optimization

    View Slide

  13. TL;DR: Cache following items
    • ios/Pods/
    • $HOME/Library/Developer/Xcode/DerivedData

    View Slide

  14. Pods caching result
    • flutter build ios: 172sec 㱺 99sec (-73sec)
    • cache-pull: 9sec => 11sec (+2sec)
    • cache-push: 58sec 㱺 72sec (+14sec)
    Very effective
    !

    View Slide

  15. DerivedData caching result
    • flutter build ios: 140sec 㱺 54sec (-86sec)
    • cache-pull: 15sec => 15sec (+0sec)
    • cache-push: 85sec 㱺 141sec (+56sec)

    View Slide

  16. Non effective items on my project
    • build/
    • ios/Flutter/
    • ios/.symlinks/
    • $HOME/.gradle/
    • android/.gradle/
    cache-push tooks too long time for .gradle on my project.

    View Slide

  17. References
    • "60% faster builds: force Xcode to use caching on Bitrise!"
    https://medium.com/@bitrise/60-faster-builds-force-xcode-
    to-use-caching-on-bitrise-af8979ca39a6
    • "Cache Gradle dependencies on Bitrise" https://
    medium.com/bitrise/cache-gradle-dependencies-on-
    bitrise-cf19a2580d07

    View Slide

  18. Faster "flutter analyze" and
    "flutter test"?
    Sorry, I have no idea now ¯\(π)/¯

    View Slide

  19. Other ideas
    • Put dependencies to the repo
    • Use build scheduling for long workflows
    • Pay for Bitrise
    • Concurrent build for ios and apk

    View Slide

  20. Summary
    Caching following items, and using new Flutter Hybrid stacks
    will be efficient.
    • ios/Pods/
    • $HOME/Library/Developer/Xcode/DerivedData

    View Slide

  21. Thanks

    View Slide