Long build times with MOE

BUILD TIMES

For the build time measurement I am supposing a development scenario with frequent restarts after small changes. In my test I measured the time to start an app in debug mode on the simulator (iPhone 5, iOS 10.3) after changing a single line (print statement) in the viewDidLoad method of the main view controller. The time was taken from pressing the corresponding keyboard shortcut until the IDE stopping at the break point in the first line of the viewDidLoad method (that was changed before).

Setup

  • Hardware as mentioned in previous post
  • MOE:
    Eclipse Plugin v 1.3.6
    Gradle buildship plugin
    Gradle Version 2.14.1 (as generated by MOE) and later 3.5 after updating the wrapper
    Gradle Daemon enabled
    Gradle VM setup Xmx2048M
    proguardLevel ‘app’ (as suggested for development)
    debug and release variants
  • RoboVM:
    IDEA Plugin org.robovm.idea-2.3.1-with-debugger-20170505 from here: https://gitter.im/MobiDevelop/robovm
    IDEA Gradle integration for dependency managment
    IDEA VM setup Xmx2048M
  • Test-App
    Real-World App with about 5800 classes on the classpath, starting only a SinglePage View but loading required classes.

Results

  • Start time of MOE with Gradle 2.14.1: 58s
  • Start time of MOE with Gradle 3.5: 54s
  • Start time of RoboVM IDEA PlugIn: 25s

Observations

  • Start time of MOE is independent from debug or release mode setting.
  • Task moeGenerateUIObjCInterfaces takes longest.
  • Explicitly setting proguard level to ‘app’ did not have an effect.
  • RoboVM Plugin: Xmx setting is mandatory for the project with thousands of classes.
  • RoboVM compiler works completely multithreaded using all CPU cores with 100% (8 Threads)
  • Compiling the MOE app uses only a part of the available CPU cores.

Hope, that helps.

Hi,

thanks again for the report.

The moeGenerateUIObjCInterfaces task should only be required if you are defining UIViewController classes in Java, then want to generate ObjC stubs from them to use Storyboards. Are you using this feature?

If not, then you can disable this task with the following setting in your build.gradle.

moe {
    moeGenerateUIObjCInterfaces {
      setInputFiles([new File("none")])
    }
}

Please let me know if this change improves your build times and by how much.

Best Regards,
Gergely

2 Likes

Hi,
I have tried to speed up the build process as described. There is no effect on the build time. Maybe I misinterpreted the output from gradle. It looks like follows displaying moeGenerateUIObjCInterfaces for a very long time:

:moeMainRetrolambda
:moeGenerateUIObjCInterfaces UP-TO-DATE
:moeMainDex

I suppose, the really long running task is moeMainDex and the line appears only after being finished. So, there seems to be no possiblity to further speed it up.