Let's collect some `ionic` build times!


#1

Ionic CLI uses @ionic/app-scripts to build your Ionic project from src to www when you run one of these commands:

  • ionic serve
  • ionic cordova run
  • ionic cordova emulate
  • ionic cordova build
  • ionic package
  • npm run ionic:build

(and more, all of course with multiple different params like --prod, --release etc.)

As we run these commands all the time, the time spent waiting for us to finish the build process, these effectively are our “Compiling!” these days:

I thought it would be neat to collect some real world build times you and we all are having in out Ionic projects. Luckily app-scripts already includes timings of how long the individual steps take to finish, so this is as simple as copying the output you get to the forum here. Maybe this can be used to optimize the build times.

Please write a few info bits about your project,
then post the command(s) you are running with their output(s),
and finally your ionic info output for environment information.


#2

This is a super simple project (tabs, 4 pages) where I am just testing some (possible) bugs:

ionic serve:

PS C:\Users\Jan\Documents\yatsa> ionic serve
[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to
       cancel
[15:27:56]  watch started ...
[15:27:56]  build dev started ...
[15:27:56]  clean started ...
[15:27:56]  clean finished in 6 ms
[15:27:56]  copy started ...
[15:27:56]  transpile started ...
[15:28:01]  transpile finished in 4.88 s
[15:28:01]  preprocess started ...
[15:28:01]  deeplinks started ...
[15:28:01]  deeplinks finished in 69 ms
[15:28:01]  preprocess finished in 78 ms
[15:28:01]  webpack started ...
[15:28:02]  copy finished in 5.34 s
[15:28:20]  webpack finished in 18.85 s
[15:28:20]  sass started ...
[15:28:22]  sass finished in 1.76 s
[15:28:22]  postprocess started ...
[15:28:22]  postprocess finished in 12 ms
[15:28:22]  lint started ...
[15:28:22]  build dev finished in 25.66 s
[15:28:22]  watch ready in 25.83 s
[15:28:22]  dev server running: http://localhost:8100/

[INFO] Development server running
       Local: http://localhost:8100

further builds in ionic serve, triggered by file changes:

[16:19:42]  build started ...
[16:19:42]  transpile update started ...
[16:19:42]  transpile update finished in 78 ms
[16:19:42]  deeplinks update started ...
[16:19:42]  deeplinks update finished in 168 ms
[16:19:42]  webpack update started ...
[16:19:43]  webpack update finished in 967 ms
[16:19:48]  build finished in 6.36 s

[16:19:48]  build started ...
[16:19:48]  transpile update started ...
[16:19:48]  transpile update finished in 127 ms
[16:19:49]  deeplinks update started ...
[16:19:49]  deeplinks update finished in 160 ms
[16:19:49]  webpack update started ...
[16:20:04]  webpack update finished in 14.83 s
[16:20:04]  build finished in 15.46 s

ionic cordova run android:

PS C:\Users\Jan\Documents\yatsa> ionic cordova run android
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --e
xternalIpRequired --nobrowser

[15:26:11]  build dev started ...
[15:26:11]  clean started ...
[15:26:11]  clean finished in 15 ms
[15:26:11]  copy started ...
[15:26:11]  transpile started ...
[15:26:18]  transpile finished in 6.91 s
[15:26:18]  preprocess started ...
[15:26:18]  deeplinks started ...
[15:26:18]  deeplinks finished in 74 ms
[15:26:18]  preprocess finished in 76 ms
[15:26:18]  webpack started ...
[15:26:19]  copy finished in 7.31 s
[15:26:37]  webpack finished in 19.12 s
[15:26:37]  sass started ...
[15:26:41]  sass finished in 3.49 s
[15:26:41]  postprocess started ...
[15:26:41]  postprocess finished in 13 ms
[15:26:41]  lint started ...
[15:26:41]  build dev finished in 29.74 s
> cordova run android
ANDROID_HOME=C:\Android
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Subproject Path: CordovaLib
Starting a Gradle Daemon (subsequent builds will be faster)
[15:27:29]  lint finished in 48.18 s
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskIn
puts.file(Object).skipWhenEmpty() instead.
:preBuild
 UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:transformClassesWithDexForDebug UP-TO-DATE
:mergeDebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 52.611 secs
Built the following apk(s):
        C:/Users/Jan/Documents/yatsa/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=C:\Android
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
No target specified, deploying to device '02e7f7e9215da7f8'.
Skipping build...
Built the following apk(s):
        C:/Users/Jan/Documents/yatsa/platforms/android/build/outputs/apk/android-debug.apk
Using apk: C:/Users/Jan/Documents/yatsa/platforms/android/build/outputs/apk/android-debug.apk
Package name: io.ionic.starter
LAUNCH SUCCESS

ionic info:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.12
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.5.0

System:

    Node       : v8.1.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3