This object is in archive! 

Program starting time 30 sec.

Dainius Rudzionis shared this problem 4 years ago
Solved

After update to 3.38.4 program starting time about 30 sec.

Best Answer
photo

Hello guys,

thanks to bongo's precise testing, I believe I have found a reason for this slowdown. Even before the main map screen is visible, Locus Map test if there are any new maps. For this, it checks the content of every directory and subdirectory of "mapsVector" (or custom) directory. I know that Android SD card API is slow, but did not expect that THIS SLOW. I was able to simulate issue on own device and also with some caching, reduce this time to 10%. So in my case from 15 secs to 1.5 sec. Not best, but definitely a lot better. Fix will be included in next bug-fix version 3.38.7 (most probably in the second half of this week).

Thank you for the patience and help with this issue.

One note: because of weird limitations on SD card access since Android 5+, and even that Locus Map supports some data on SD card, I may only highly recommend placing everything into internal memory. Speed benefits (not just the start of the app) are usually noticeable.

Replies (25)

photo
1

Hi,


we are sorry for the inconveniences and we are working hard on fixing the bugs. Please update to Locus Map 3.38.2. and let us know if the issue is gone or not. Thanks!


best regards


Michal, Locus team

photo
1

ok, i retested with 3.38.2:

- seit dem wechsel auf die neue kartenengine dauert das aufstarten von locus viel länger.

3.38: when starting locus, the white screen showing startup progress appears immediately. scanning local maps takes a long time. especially loading .sqlitedb maps seems to take forever.

3.38.2: when starting locus, i just get a black screen for up to 10 seconds (or even longer). then i get the startup progress screen. now the .sqlitedb maps don't seem to be a problem anymore...but overall time for startup is still about the same, i.e. much longer thatn with the version before 3.38.


- ausserdem wird bisweilen nach dem starten nicht die letzte verwendete karte, sondern eine onlinekarte angezeigt. wenn für diesen bereich aber keine onlinekarte zwischengespeichert ist erscheint an stelle der karte eine weisse fläche.

3.38: i always get a white background with a text like "online map" (instead of the last map used) when starting up.

3.38.2: i sometimes get the last map used (which would be fine) and sometimes get a white background without any text.


- nach dem starten von locus kann es bisweilen eine weile dauern bis die POIs auf der karte angezeigt werden

3.38: sometimes it takes several seconds until any pois are shown on the map

3.38.2: seems to be still the same


regards

tinu

photo
1

Hi Tinu,

the slow initialization - we know about it. Probably some unwanted side effect of the new map core. WIll need more analyzing, testing and developing. hopefully we'll fix it till the next production version in June.

Other issues - please test them on the newest 3.38.3. and let me know the results. Thanks

Michal

photo
1

ok, hope that next release will solve the startup delay issue.


after starting locus many times, i only once had the problem that no map was shown (locus switched to online map) since updating to 3.38.3. so this might be improved with the new version.


loading pois still may take a long time. when the map is shown (after the slow startup process), i did tests where after 2 minutes, still no pois have been shown on the map.

i've recognized that moving the map around may speed up poi loading, i.e. when moving the map around as soon as it is shown, it usually only takes a few seconds to load the pois.

(btw: i use live update of the pois)

with locus versions prior to 3.38, the effect that poi loading takes that long only occured after rebooting of the phone, but never after just terminating and restarting locus.

one thing i've observed is, that when terminating locus, it first removes all pois from the map before locus terminates. i think this has not been like that with older versions. might this be a reason for the effects seen?

tinu

photo
1

"Live update of the pois" - so you mean geocaching live map? It is served by the Geocaching4Locus add-on which is developed and maintained by another company. It streams data from the internet so there may be other factors involved. The caches are not stored - they are always streamed so when there is some obstacle in internet connection, the speed slows down.

Michal

photo
1

no. i use the gsak addon to get the pois into locus "on the fly" using live update (this still works fine up to android 7). unfortunately, with android 8 and later, this addon only works for importing from gsak db.

photo
1

well, the GSAK add-on is (was) also provided by somebody else. For some time the add-on development has been abandoned and we have no influence on its performance.

Michal

photo
1

Another topic about the gsak addon and live updates of waypoints you can find here.

photo
1

at least one of the issues is not solved at all. it still persists:

- seit dem wechsel auf die neue kartenengine dauert das aufstarten von locus viel länger.

3.38: when starting locus, the white screen showing startup progress appears immediately. scanning local maps takes a long time. especially loading .sqlitedb maps seems to take forever.

3.38.2: when starting locus, i just get a black screen for up to 10 seconds (or even longer). then i get the startup progress screen. now the .sqlitedb maps don't seem to be a problem anymore...but overall time for startup is still about the same, i.e. much longer thatn with the version before 3.38.

this cannot be shifted to any addon for sure!

tinu

photo
1

HI Tinu,

I've wrote to you already:

"the slow initialization - we know about it. Probably some unwanted side effect of the new map core. WIll need more analyzing, testing and developing. hopefully we'll fix it till the next production version in June."

Michal

photo
1

Good day Dainius,

Does this issue happen after every start of Locus Map app? What if you restart your device, is the result same?

Also what happens during these 30 seconds, you see just a black screen?

Menion

photo
1

It happens every time you start Locus Map even after the restart the result is the same. During that time, I can only see the black screen before the login mode starts.

photo
1

Hi, Menion

It happens every time I start program. Device restarting didn't help. During Locus map starting I see black screen

2019-06-14, pn, 22:32 Locus Map <locus.map@asamm.com> rašė:

photo
1

Good day Dainius and Pavel,

sorry to hear it. I'm a little worried that this won't have a simple solution for now. Write to me please also what devices are you using and if you have default or any alternative ROM installed. Thank you.

photo
1

Hi, Menion

I using Samsung Galaxy s5 neo. Internal memory 16 Gb (used 12Gb). External memory 64Gb. All maps are in external memory

photo
1

Hello,

so nothing too old or too weak, Locus Map should work with your device perfectly.

Unfortunately, I do not have a solution for now. Maps should cause no problem as they are initialized later when app UI is already visible. Anyway, you may still give a try to some optimizations and hide all points and tracks, disable shading and overlay map if you use.

Since 3.38, we switched Locus Map to new application format and seems it is causing so huge delays at app start. I already found a few places where this may be improved, unfortunately, it will take some time till it will be a priority no. 1 (few months, sorry).

So for now, if this is a serious problem, I may only offer previous 3.37.2 version. Thanks for understanding.

photo
1

Hi, Menion

Restart of the phone doesn't resolve the failure.

I using Samsung Galaxy s9. Internal memory 60 Gb (used 40 Gb). External memory 120 Gb. All maps are in external memory. It has been doing since version 3.38.

photo
1

hi michal

after locus updated to 3.38.4 yesterday, startup behaviour got even worse.

now, when starting locus, i first get a black screen for more than 1 minute until the startup screen opens.

then, showing the startup screen again takes 1 minute or more until locus is operational.

regards

tinu

photo
1

just to add some more info:

i see this issue (2 minutes or more to start) on a samsung s5.

i thought this might be better on a newer cubot x18 so i also tested on this device.

on a first start, it was exactly the same as with the s5 (more than 2 minutes). then, later on, i still have 1 minute of black screen, but then it immediately shows the map and no locus startup screen.

photo
1

Damn this is almost impossible. There is nothing Locus Map can do at start so long.

May anyone from your simply restart device, wait a minute till everything starts and then start Locus Map. If the issue happens again, immediately after app start, create a log by this method. Please rather check how to do a bug report before you will need it, to be ready right after app starts. Thank you and really sorry for this unexpected problem!

Menion

photo
1

hi menion

i sent you the bug reports from both devices by email. hope they came through...

for no known reason, this time startup was much faster...but still took quite long.

black screen was almost 1 minute, but then i didn't get the locus startup page. instead, locus was ready immediately. then.

regards tinu

photo
1

i tried to revert to 3.37.2, but when trying to install this version over the actual locus, it did not install (no error message, just the info that it did not install).

do i have to do something special to revert to 3.37.2?

i think uninstalling the actual version first would be a bad idea as this would also delete all the data. right?


and btw: did the logs i sent you show anything special?

photo
1

I just updated Locus Maps Pro to the latest version from Google Maps on a Samsung Galaxy S2 with Version 7.0. When starting the app, it remains on a black screen for MINUTES or even longer until the message appears: Locus Map reagiert nicht (doesn't react). Continuing with wait stays further on black screen. Currently Locus Maps is near to unusable on my Tablet. 5 or more minutes later Initialisation starts and again hangs at 20% for several minutes to start Offline Maps. It seems to me, that LMP produces tons of error messages, which I saw on screen, but can not interpret and clicked away (Fehler: Unbekanntes Problem, wxWidget , HTML, ... Please help. I have urgend need of LMP for my next Trip to France on Friday !!!

photo
1

I now have created a bugreport-2019-06-19-09-02-25.zip, which is available for you on my google drive. please check your emails!

photo
1

Good day bongo & Guenther

thank you both for your logs. I clearly see that app starts and after a while, it just hangs for a minute, two and nothing happen even in device seems that nothing serious happens. I have unfortunately no idea, no clue why this happens on your two devices.

In the case of Guenther, I see a huge list of errors at start. In your case it is most probably because of added directory "storage/0000-0000/Computer/Programmierung/Python/wxPython/" into external maps, it is possible? There seem to be many files that end with ".map" ending which Locus Map test and then report that it's invalid map format. Anyway, it may not cause so huge delay.

May someone of you give a try and make a clean Locus Map install?

For this, best is to do

  • do a backup of settings over "menu > More > backup manager"
  • close Locus Map by double back press
  • rename "Locus" directory in internal memory to some other, to keep its data safe
  • and finally, re-install Locus Map over Google Play

The app will after start create a new empty directory, which you may simply remove if the test will fail and rename old directory back.

Does it make any difference?

photo
1

I have no idea how Locus Map happened to use this directory for default of vector maps. I indeed use an additional directory (0000-0000/mMyLocusExternMaps/ for my maps and this always worked fine and now after reinstallation again. Anyway, I did a clean installation which is now version 3. 38.4 And now start-up time is okay with short time black screen and very fast installation screen. Because of no backup I have lost tracks and waypoints, but that's not really a problem because they can be reimported easily.

Although on my smart phone Samsung Galaxy S5 it seems to me that Locus Maps does not complete initialization. After opening the main screen it permanently shows "Initialisierung ..." (Initialization) in the title bar, although functions are available, and Locus Maps seems to be fully responsive. What is going on there?

Thanks for your support

photo
1

Good day Guenther,

seems you have too many devices and I'm little lost now. Anyway, you wrote you lost all your data: did you just renamed your Locus Map directory? You may as the first step, delete new created empty "Locus" directory and rename old one back to "Locus". Of course, close Locus Map app before this operation.

Anyway new installed helped, interesting. A short black screen is ok. We will try to get rid of it, but it will need more invested time.


Initializing in top panel is also interesting. We tried to get the same problem on some device with my colleagues, but no luck so far.

photo
1

Well, I found the solution myself by accident. GPS in smart phone options was not yet activated. So this message is a little bit confusing. It would be more helpful if Locus Map could indicate this instead of just informing initialising.

photo
1

Ah it was a message about GPS, very good to know, thank, I'll improve it!

So start is ok now, perfect. What about your points/tracks? May I help somehow with restoring?

photo
1

hi menion

have you also seen anything special in my logs?

and btw:

i'm still waiting for advice on how to revert to 3.37.2 which failed (see my post from 5h ago).

so this would hopefully help me out of these problems.

thanx!

photo
1

Hi,

- you must uninstall the current version before downgrading

- if your root Locus directory is in the internal memory, it probably won't be deleted but I'd rather recommend to make a backup of it

- install the older version

- overwrite the newly created Locus directory by the old directory

- restart Locus

photo
1

all my locus data are on the external flash card. so i think uninstalling will delete all ;-(

photo
1

then make sure you create a backup of it all

photo
1

After update to version 3.38.6 nothing changed. Locus starting time about 30 sec.

photo
1

Good day Dainius,

I made some smaller changes but seems it had no effect, shame. I'm unfortunately sorry, but I have absolutely no idea, even from logs, why this happen, so no chance to fix it now.

As I mentioned before, it is possible to re-install the current version of you may downgrade Locus Map to previous 3.37.2 version that probably worked correctly.

photo
1

looks like i found some interresting clues:

i installed locus from google play on a new samsung s7 (out of the box), added my maps and all data i had on my samsung s5 and the result is: exactly the same behaviour as i see on my s5, i.e. it takes forever to start.

then is started to play aroud with folder settings. i found out that, if the folder for vector maps points to the external sd card (in my case it's Card\locus\mapsVector) then i get the black screen for about 15 seconds, as long as this folder is empty. then the more maps i have in this folder, the longer i get this black screen at startup.

if i set the folder for vector maps to Card\Android\data\menion.android.locus.pro\files\Locus\mapsVector instead, i only get the black screen for a few seconds, no matter how many maps i have in the folder.

looks like there is a problem with vector maps being in a read-only folder, since version 3.38.

did you change something with map initialization? until version 3.37, this was no problem.

regards

photo
1

I am using Locus Pro 3.38.6 on my Samsung Galaxy Note 4 running stock rom Android 6.0.1.

On my external sd-card there is a folder /extLocus/mapsVector containing some sub-folders with offline vectormaps. I. e. /europe containing 3 lomaps with about 3.5 GB size, /OAM-V3 containing 5 openandromaps V3 with about 4.9 GB size and /OAM-V4 containing 5 openandromaps V4 with about 6 GB size.

For me there is no recognizable difference in speed when starting locus 3.38.6 compared with locus 3.37.x.

I named my locus folder on external sd card /extLocus because I read somewhere in this forum that locus gets in trouble, if the folder on internal and external sd card named /locus. I. e. the locus folder on external sd card should not be named \locus.

photo
1

maybe this depends on android version. i recognized this on android 7.

photo
1

i repeated this test on my samsung s5, running android 5:

when moving vector maps from extSDCard\Locus\mapsVector to extSDCard\Android\data\menion.android.locus.pro\files\Locus\mapsVector, the black time on startup of locus is reduced from more than 1 minute to about 20 seconds, and overall startup of locus is reduced from 2 minutes to 45 seconds.

so i'm quite sure that the problem has something to do with the location of the vector maps.

photo
1

Hmm, access to SD card is usually slower, but not that much. Also initialization of maps happens when main map screen loads, not sooner.

One more thing to test ... check if you have in this custom mapsVector directory also subdirectory "_themes"-. If so, rename it and start Locus again if this makes a difference. This directory may contain quite a lot of small files and I remember it cause problems in some cases.

photo
1

i don't think that it's an issue of SD card or internal memory. as i have no internal memory left, i have all maps on SD card.

but when i have the vector maps in the dedicated locus folder under extsdcard/android/data/menion.android..., startup is much faster than if i have them in another folder where locus has no write access.

i checked the impact of the _themes folder (in both mapsvector locations). renaming it has no impact to startup time.

it looks as if locus would try to write something to the mapsvector folder at the very beginning, and then waits for a timeout. but for some reason, this timeout scales up with the number of maps in the folder.

there's one more thing: when i have all my vector maps moved to extsdcard/android/data/menion.android... and select the folder extsdcard/locus/mapsvector as the folder for vector maps (with no maps left there), locus accesses the vector maps under extsdcard/android/data/menion.android... although this location is not selected.

photo
1

I'm not saying that the problem is in your SD card!

The issue is definitely in a) implementation of this system in Android itself and also have to be b) in Locus Map itself, because it previously worked correctly.

If possible, use, for now, the method that works for you and I'll try to simulate the same issue on own device with SD card and Android 7.0. Thanks for the time you invested in testing!

Menion

photo
1

hi menion

yes, that's for sure the way i need to go now, although i preferred to have the maps in a folder outside the android tree.

just to clarify: i see the same issue on a samsung s5 running android 5 (locus is running there for years) as well as on a samsung s7 (out of the box) running android 7, where the actual locus version is the first one installed ever.

both devices have a samsung evo sd card installed.

hope you soon find the reason for the startup delay - thanx!

photo
2

Hello guys,

thanks to bongo's precise testing, I believe I have found a reason for this slowdown. Even before the main map screen is visible, Locus Map test if there are any new maps. For this, it checks the content of every directory and subdirectory of "mapsVector" (or custom) directory. I know that Android SD card API is slow, but did not expect that THIS SLOW. I was able to simulate issue on own device and also with some caching, reduce this time to 10%. So in my case from 15 secs to 1.5 sec. Not best, but definitely a lot better. Fix will be included in next bug-fix version 3.38.7 (most probably in the second half of this week).

Thank you for the patience and help with this issue.

One note: because of weird limitations on SD card access since Android 5+, and even that Locus Map supports some data on SD card, I may only highly recommend placing everything into internal memory. Speed benefits (not just the start of the app) are usually noticeable.

photo
1

After updating to version 3.38.7 situation became good enough. Programm starting time 3-5 sec.

Thanks

photo
1

Good day Dainius,

still not an ideal but definitely better result. Thanks!

Menion

photo
1

Ahoj Menione

Po poslední aktualizaci se rychlost načítaní při spuštění Locusu podstatně zrychlila. Díky

photo
1

@Menion


How do you access SD card contents over SAF?

Don't use any list methods because each entry will create a seperate file detail request.If you have more then 10 files you need to directly query them.

I could reduce file listening of only 60 files form 1.5s to 0.1s on an S4 mini by using


Uri treeUrl = DocumentsContract.buildChildDocumentsUriUsingTree(mFolderUri, DocumentsContract.getTreeDocumentId(mFolderUri));

getContentResolver().query(treeUrl, fields, null, null, null, null));


instead of


DocumentFile folder = DocumentFile.fromTreeUri(this, mFolderUri);

folder.listFiles()


Please check if you do use listFiles() anywhere, because this is one example of painfull slow types of using storage access framework. I'm still shocked from that listFiles() experience.

After that, I don't trust any DocumentFile methods without checking how they performe with 5-10 files. It's just ridiculous how many CPU cycles get wasted with such low numbers of files.

For example getting mimetypes from DocumentFile is equally worse. I just guess that each method call is translated to a SAF query...

photo
1

And keep in mind that SAF query can't sort or filter. I did try to be smart and ended up removing sort and filter from my query because they got ignored.

But even with manually sorting und filtering it is with 0.2s still alot faster then using DocumentFile class.

photo
1

Good day Falco,

I'm well aware that work with Documents is really pain, not just because of performance. I'm anyway surprised by speed benefit with your function because you suggest exactly what "listFiles()" do under the hood, check here.

Are you using AndroidX package and not older support library? There were some changes.

Anyway, this does not belong to the public topic (also because exactly this was not the real source of this problem.).

photo
1

You are right, after checking android sources my results did include mime type and modification date queries. My phone is just slow, each query will take long time :D


I have to find out how to find the sources behind the interfaces faster. It would save me alot of trouble if I would have seen this.

Replies have been locked on this page!