Android Question What influences the compilation time?

wimpie3

Well-Known Member
Licensed User
Longtime User
I have added ten new Activities to my app, and compilation time went from 1 to 5 seconds.

Is this normal? Is the number of Activities one of the factors that influence the compilation time? Are there other factors to take into consideration?
 

Ratna Fang

Member
Licensed User
Longtime User
hi erel,

i have 92 files in files folder and they are all very small dimension, total size is 765 KB.

10 activities and 2 services, 18 libs.
total size of apk is 2.7 MB.

do you think the number of files in files folder is affecting when we compile a project?

*because i need to close the project, then re-open again, set the MaxRamForDex=4096 everytime i compile. my proc is 3.6 GHz quad core AMD, ram 8GB, os: win7

sometime i can get around 14-19 secs only for optimized dex, but i often get more than 50 secs (so i need to close and re-open the projects).
 
Upvote 0

Ratna Fang

Member
Licensed User
Longtime User
ah ic. if it's caused by latest google play service jar, i have to wait their next update :(

it's really strange. if i close and re-open the project, set the parameter, then compile, it took around 20secs only. but then if i compile later without closing the project, it took long time to compile and i often got error, switching to standard dex, etc.

i tried to uncheck several libs (hope it will make lighter and faster compilation time). so now i only have admob, google map, location api, string function, json, http, http2. of course i'm using the latest google play server jar (the fat one) :)
 
Upvote 0

Ratna Fang

Member
Licensed User
Longtime User
i set everytime the IDE open the project. if i set when the IDE is close, it will overide the value back to 512. i set to 4096 before compiling.

well it's time to get a bigger PC with bigger memory
 
Upvote 0

Ratna Fang

Member
Licensed User
Longtime User
hi erel,

i don't know if it would be my luck.
i increase the java ram allocation by setting in the environment variables of windows 7.
so i set to 1G and now b4a compile very fast from previously around 120 secs and often error, now it takes only a few secs around 3 secs.
Setting Java 1.png
Setting Java 2.png
here is the result:
Hasil 1.png

ah....sacrificing 1G of RAM for java and then my wonderful life is back :)
have a nice weekend.... worth for beers :D

my tiny projects is only:
16 libs
2 services
10 activities

use the latest google play service jar
the apk size is 2.3MB

*use my 2 yrs AMD FX-4100, 3.6 GHz quad core, RAM 8GB, win 7 SP1 64-bit
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
i set everytime the IDE open the project. if i set when the IDE is close, it will overide the value back to 512. i set to 4096 before compiling.
About this issue. The IDE only reads the INI file when the IDE starts. You should make sure that there are no open IDEs and then update this value (if it is still relevant).
 
Upvote 0

Ratna Fang

Member
Licensed User
Longtime User
so the best moment to edit the value is before opening the IDE? not before compiling?

*i'm upgrading the RAM to 16GB so i can spend more memory as this PC is for developing android apk :)
 
Upvote 0
Top