Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
26
Erster Beitrag:
vor 1 Jahr, 5 Monaten
Letzter Beitrag:
vor 4 Monaten, 4 Wochen
Beteiligte Autoren:
ccc2, Danny Lauwers, kingdr, Ruben Sanchez Peña, Arie, ICI

wm21 slow compile and deployment

Startbeitrag von ccc2 am 12.07.2016 12:45

Hi,

my notebook
Intel® Core™ i7 6500U
12 GB Ram
500GB ssd 850 evo

android Sdk 23
gradle 2.14

tablet
cyanogenMod android 4.4.2

APK size 7mb

compile take 40 seconds (rerun same time) , deploy over wi-fi take 25 seconds (rerun same)

is there anyway to speed up ?


I had tried add some setting in gradle.properties.
http://forum.pcsoft.fr/fr-FR/pcsoft.us.windev/57886-wm21-gradle-57887/read.awp

but i found out that this file is overwrite whenever compile the project. anyone know the correct way to add gradle properties in WM21 ?

Antworten:

Hi

Nothing much as the bottle neck is on Java stuff when generating APK and that's
why I generate ios apps for iPhone instead. Yours is with CPU benchmark of score 4324,
while the desktop of i7 might have 9000-12000, even though I guess it's only 50% fastest than yours.

Just FYI and nothing much to help out :(

Cheers

King

von kingdr - am 12.07.2016 12:54
Hi,

Under your user document folder "My Documents" there is a ".gradle" folder where the settings are that the Java compiler uses.

It is in a file called gradle.properties

I have these settings

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

com.android.build.gradle.overridePathCheck=true


Maybe you can try and see if they improve your compile time.

Danny

von Danny Lauwers - am 12.07.2016 15:26
thanks danny , but no different.

this is what i think how to set gradle properties in wm21

based on gradle documentation

The configuration is applied in following order (if an option is configured in multiple locations the last one wins):

from gradle.properties in project build dir.
from gradle.properties in gradle user home.
from system properties, e.g. when -Dsome.property is set on the command line.

system properties can be set in gradle.build . in wm21 gradle,build is set in WDJava.build file

C:\WinDev Mobile 21\Programs\Framework\Android\WDJava.build

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}

System.properties [ 'com.android.build.gradle.overrideVersionCheck'] = 'true'
System.properties [ 'org.gradle.daemon'] = 'true'

System.properties [ 'org.gradle.jvmargs'] = '-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8'
System.properties [ 'org.gradle.parallel'] = 'true'
System.properties [ 'org.gradle.configureondemand'] = 'true'
System.properties [ 'com.android.build.gradle.overridePathCheck'] = 'true'


}



--------------------------------------------

android {
dexOptions {

incremental = true
preDexLibraries = false
jumboMode = false
javaMaxHeapSize = "2g"

}


when I compile no error and i can see decrease in free memory when i run compile.
too bad it's still taken 40 seconds to compile. :(

von ccc2 - am 12.07.2016 16:42
Hi . I don't think you could speed up more the process. You must add the WM code generation time to Gradle process time. I think the total time depend of project content, and if you use Maven external libraries the time will be more and more.

Gradle make a great job to optimize the process time with daemon and the other options.

The \.gradle\gradle.properties file can configure the Gradle process options and it isn't touched or modified by WM or Gradle. http://forum.pcsoft.fr/fr-FR/pcsoft.us.windev/57886-wm21-gradle-57887/read.awp

Rubén

von Ruben Sanchez Peña - am 12.07.2016 23:21
I tried that also , same 40 seconds.

without the code , the compile took about 50 seconds but it still faster than using gradle 2.2 (more than 1 minutes) .

what I don't understand is the same code compile in wm20 took half the time to compile and deploy than wm21.

I don't know how big a project need too ,so that we can see the advantage of using gradle.

now it make me think ,may I should just continue the develop the app in wm20 and only when I need functions that support by wm21 then I go there .

:joke: I know that is stupid idea :joke:

von ccc2 - am 13.07.2016 01:45
Hi,

Probably it is also the new DEX function to support more that 65536 functions in a APK. When I enabled that in WM20 it was also a lot slower. Probably this is now enabled in WM21 by default ?

In the Advanced configuration you could try to disable "Reduce the size of generated code" and the disable "Enable the Multidex generation". If you'r app is not that big these options would not be that important.

Danny

von Danny Lauwers - am 13.07.2016 06:11
Quote
Danny Lauwers
Hi,

Probably it is also the new DEX function to support more that 65536 functions in a APK. When I enabled that in WM20 it was also a lot slower. Probably this is now enabled in WM21 by default ?

In the Advanced configuration you could try to disable "Reduce the size of generated code" and the disable "Enable the Multidex generation". If you'r app is not that big these options would not be that important.

Danny


both are disable

I tried enable it just for testing. the compile took 135 seconds .

von ccc2 - am 13.07.2016 10:16
Hi

Try this as you have tons of RAM

org.gradle.jvmargs = -Xmx4096m or more like -Xmx6144m and

see this link

"http://www.viralandroid.com/2015/08/how-to-make-android-studio-fast.html";

if it helps.

HTH

Cheers

King

von kingdr - am 13.07.2016 11:26
Quote
kingdr
Hi

Try this as you have tons of RAM

org.gradle.jvmargs = -Xmx4096m or more like -Xmx6144m and

see this link

"http://www.viralandroid.com/2015/08/how-to-make-android-studio-fast.html";

if it helps.

HTH

Cheers

King


i tried that before . no change in speed .
when change from 1gb to 2 gb the compile speed faster but from 2gb to 4 gb , no different . from 4gb to 6gb , slower (between 5 to 10 seconds slower)

from windows task manager I can see the memory is allocated and cpu 100% in used during compile process .

if there are no way to increase speed of compile then no choice but why is it deploy took 25 seconds . on wm20 deploy took 5 to 10 seconds . I tried manual deploy using adb is also took 7 second only. why wm21 took so much time to deploy . this part I don't understand and I always start adb connection (tcpip) prior starting WM.

von ccc2 - am 13.07.2016 12:21
Hi

Did you check off-line

Check the 'Offline work' under 'Global Gradle settings'
and it will reduce 90% gradle build time.

Perhaps see this for short

http://stackoverflow.com/questions/29391421/android-studio-gradle-takes-too-long-to-build

or consult pcSoft why wm21 is much slower than wm20.

I guess you're running w7/w10-64bit and certainly it runs faster in Lubuntu 16.04 -64bit
with the same machine as yours.

HTH

King

von kingdr - am 13.07.2016 12:49
Hi. Tried. No change.

In my case the times generating my app are: (ever 5 sg to WM generate the java code and prepare the android folder)

First generation (Daemon isn't running): 47 sg
Second generation (Daemon is running): 32 sg
Rest generations (Daemon is running): 19 sg

More memory doesn't change noting. The Java Daemon memory usage is 2GB, no more.

Maybe if i could implement the --offline option when i doesn't use Maven the generation could be more quickly.

Rubén

von Ruben Sanchez Peña - am 13.07.2016 13:08
Quote
kingdr
Hi

Did you check off-line

Check the 'Offline work' under 'Global Gradle settings'
and it will reduce 90% gradle build time.

Perhaps see this for short

http://stackoverflow.com/questions/29391421/android-studio-gradle-takes-too-long-to-build

or consult pcSoft why wm21 is much slower than wm20.

I guess you're running w7/w10-64bit and certainly it runs faster in Lubuntu 16.04 -64bit
with the same machine as yours.

HTH

King


thanks King. now only took 20 seconds to compile :D

von ccc2 - am 14.07.2016 01:45
Hi,

Could you share your Gradle configuration (Gradle.properties file) so other could also gain some speed ?

Thanks
Danny

von Danny Lauwers - am 14.07.2016 12:10
Hi,

make sure install gradle 2.14 , edit C:\WinDev Mobile 21\Programs\Framework\Android\WDJava.build

add the text i highlight in red

---------------------------------------------------------------------------------------------------
buildscript {

repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}

System.properties [ 'com.android.build.gradle.overrideVersionCheck'] = 'true'
System.properties [ 'org.gradle.daemon'] = 'true'
System.properties [ 'org.gradle.jvmargs'] = '-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8'
System.properties [ 'org.gradle.parallel'] = 'true'
System.properties [ 'org.gradle.configureondemand'] = 'true'
System.properties [ 'com.android.build.gradle.overridePathCheck'] = 'true'
System.properties [ 'org.gradle.workers.max'] = '2'



}

----------------------------------------------------------------------------------------------------
gradle.startParameter.setOffline(true)
apply plugin: 'com.android.application'

von ccc2 - am 15.07.2016 00:31
Thanks !

These are my settings in the gradle.properties file under User Map, so you don't have to change stuff in the WINDEV Mobile folder.

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
com.android.build.gradle.overridePathCheck=true
com.android.build.gradle.overrideVersionCheck=true
startParameter.offline=true
org.gradle.workers.max = 4


Build time from 40sec naar 10sec !! (Gradle Time)

Make sure you are using 64bit Java because else the Xmx parameter can max be 1024.

Danny

von Danny Lauwers - am 15.07.2016 09:57
Hi Danny,

if you count only gradle time (10 seconds) . I tried org.gradle.workers.max = 4 before .it endup slower my guess is because my cpu is only 2 cores (4 threads)


i still have 25 seconds problem in deploy through tcpip .
if i deploy using adb in command prompt. it only took 10 seconds . of course doing like that many times it is pain in as* .

since usb port on my tablet damage, i guess i will just have to live with the 25 seconds

von ccc2 - am 15.07.2016 17:11
upgrade to gradle 3.1

2 additional changes need in

//// change the repository
///from

repositories {
mavenCentral()
}

///to

repositories {
jcenter()
}

/// change android tools

///from

dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}

///to

dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}

von ccc2 - am 29.10.2016 04:36
Woow, Genial!!!

Thank You

Rubén

von Ruben Sanchez Peña - am 29.10.2016 12:08
Hi to all
My experience with WM21.

Whatever I change in WDJava.build on HP i3 with 6GB ram, SSD HDD, result=1min22sec.
This upgrade to 3.1 and changes does nothing in my case except error message and stop to generate.

Opinion:
Slowness is not a problem if emulator work same like hardware, but when you have one result on emulator and error or another result on hardware device then this slow generation is a really big problem.

Regards !

von ICI - am 02.11.2016 08:21
Update Gradle 3.3

--------------------------------------------------------------------------
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'

}

-----------------------------------------------------------------------------
android sdk tool 25.2.5
android platform tools 25.0.3
android sdk build tools 25.0.2

von ccc2 - am 20.02.2017 09:35
Update !!!! work on wm22
- gradle 3.5.1
- android sdk 26
- android tool gradle 2.3.3


I tried gradle 4 , but stuck at this error

A problem occurred configuring root project 'Generation'.
> Cannot read packageName from C:\project\myApp\Android\Generation\AndroidManifest.xml


anyone manage to solve this ?

von ccc2 - am 18.07.2017 08:43
forget put time

compile 44 second
deploy over tcp/ip 2:26:7

compile time is shorten abit while deploy extra longer. due to the extra 10MB :mad:

von ccc2 - am 18.07.2017 09:02
I manage to make compile faster to 30 seconds , for those with faster machine will be alot fastest

create gradle.properties in C:\Users\user-name\.gradle

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4608M

edtit C:\WINDEV Mobile 22\Programs\Framework\Android\WDJava.build

change
javaMaxHeapSize = '4g'



I don't know why 4608M , gradle give warning and suggest this number , after put that then no warning anymore

I still no luck with gradle 4

i try hard code
manifest.srcFile to build\intermediates\manifests\full\debug\AndroidManifest.xml

but still get new error

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt


if anyone able to get gradle4 work on WM22, please post the instructions

von ccc2 - am 19.07.2017 04:54
CCC2,
you seem to have digged into the build process, so a bit off topic:
but do know how to start the WM build process manually? I stil have an isssue on my laptop, where the build process fails (see this post http://27130.foren.mysnip.de/read.php?27131,780715,780715#msg-780715 ) saying it cannot find the pcsoft libraries. I thought of starting it outside WM with some extra debug-parameters or something like that, to track down this issue.

von Arie - am 19.07.2017 06:12
Hi Arie,

sorry , I don't know.

von ccc2 - am 19.07.2017 07:50
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.