-
-
hi, i've been rewriting the display algorithm for gipy and i'm running into performances issues.
i used to render the lines directly on the screen but in the new algorithm lines are rendered into intermediate images (created with Graphics.createArrayBuffer).
these images are then drawn on the screen with g.drawImage.the display time is now much better. displaying a full map takes on average 0.3s even in crowded areas.
it is a huge speed increase and i'm quite happy about it.however there is an issue.
usually a tile takes around 0.015 second to render.
sadly sometimes a tile will suddenly take 1.2 second to draw.
it is fully deterministic, i can reproduce it 100% of the time.
in gipy's simulator i can follow the path and when i reach point 29 i meet my slow tile.
however, if i don't follow the path but start directly at point 26 then when i follow from there and reach 29
then the display is as fast as usual.
this is very weird for me because it is the same tile in both cases and the display looks identical.any idea why drawImage could slow down 10x suddenly ?
-
-
hi, so just to let you know, i've been commenting in and out large blocks of code and i finally found the problem. there is a problem in the jit in case of array allocations.
multiple array allocations seem to trigger the bug easily but single array allocation also does it sometimes. putting back the jit i do get a 10% perf increase. that's much less than the initial 50% i got (before optimizing the code manually) but i guess i'll keep it, at least for a bit of testing.
as for the watchdog i just thought i don't really need it anymore so i should just max the interval.
i'll put it back to the standard value. thanks. -
hi, i'm not too sure.
i'm able to reproduce the crashes deterministically though.it's not the jit alone because when disabling it completely i also managed to get the bug.
i figured out that this line (758):
Bangle.setPollInterval(2000); // disable accelerometer as much as we can (a value of 4000 seem to cause hard reboot crashes (segfaults ?) so keep 2000)
seem to cause problems at 4000. just switching to 2000 it seems there are no problems anymore.
however it's not the end of the story because i have two different methods for which i'd like to use the jit. 'display_tiles' and 'display_thick_tiles'.
when i tried on both it always crashed.
when i tried on 'display_tiles' alone it used to work (before my latest changes on powersaving).
but now after the changes when i try on 'display_tiles' alone the behavior is very strange.
it does not crash but the screen flickers, with the streets not being displayed and i get weird messages in the console about incorrect code which does not exist.i was wondering if i was hitting some limits on memory size.
if you like i can help you reproduce it.
-
-
hi,
i have some problems with some unpredictable reboots when running gipy.
the watch just reboots more or less randomly. there is no error message on the console nor on the watch itself. i'm not sure what is causing this.
i know that adding "jit"; to the
display_thick_tile
method in the Map class will guarantee an immediate reboot 100% of the time. however if i don't have it there is still a reboot. if i remove the "jit"; in the display_tile method (the jit i currently use) the reboots frequencies decrease but i still have it. if i remove the widgets loading and drawing it decreases even further but i still have it.my guess is that there is a kind of memory limit i'm reaching but i don't know what.
process.Memory() is not helping me since everything seems ok.
half the memory is free, i still have 48000 of stack.i'm really not sure what to do here.
-
yes, this guy : https://pastebin.com/D5k8NFhh
is not freeing the memory.
when i start the go_to method line 358 i have little memory remaining.
however commenting out line 358 and removing comments 572-577 it works. -
yeah that's what i thought. if i declare a global "street" variable, set it in the menu handler and use setInterval in the main to detect for the variable being set then it effectively frees the menu's memory. however i expected it to be also true if using a setTimeout in the handler itself since i thought the timeout's function would not be associated with the menu (the menu's handler registers the timeout and completes) and this is not the case.
so i have the setInterval workaround which is fine, i'm not stuck but somehow it still don't get why the garbage collector is not freeing the memory if i use a timeout.
-
hi,
i'm getting tight with my memory usage so I started profiling it a little bit.
i'm actually starting my app with a few menus and these guys require quite a lot of memory allocations: i need to decompress a few arrays using heatshrink.
now, after i select my entry in the menu i can safely free all this memory and live happily ever after.
i just need to keep a very tiny array i created in the callback.however i'm not sure how to do that. i don't see how to wait in the main function for the menu to return so i usually launch my code in the menu entry's callback itself. if i do that however, all large arrays stay allocated. i tried to use a timeout to create a new task and return from the menu callback which works but does not free my memory.
i'm actually not even sure how the garbage collector is working.
i'm not sure i'm clear. my code is here : https://github.com/wagnerf42/gps/blob/main/app.js
i want to call the function on line 357 with the local street array and free the memory decompressed line 321. -
i extracted my city's ways from openstreetmap. with some clever encoding (btw i laughed at Uint24Array but it's just what i needed) i'm actually below 200k. i'm amazed it's fast enough to display on the watch with little optimisations (1.5 secs to display). i still need to add the street names and port the low mem path algorithm to javascript and we might have a full gps. i'm not still 100% sure the path algorithm will fit the ram though, it's kind of a challenge. well, all the stuff i like.
-
-
-
-
-
hi,
i'm trying to read a large file (200kb).
(i just tested on the emulator and not the watch.)using : let a = require("Storage").readArrayBuffer("test.map");
it loads but a.length is equal to 22053.if i try let a = require("Storage").read("test.map", 0, 200000);
it seems to work but i get a string and i'd rather like to turn my arraybuffer into various arrays.is there a size limit on readArrayBuffer and is there a reason for it ? do you know any kind of workaround i could use ?
thanks.
-
-
-
-
hi,
i've been developping my app for a few days and this morning i started seeing strange messages in the web ide. when running the code i got something like : uncaught syntax error got EOF in bootupdate.js
i did not pay much intention since the app went to run anyway.
however i now have the following problems :
- no bluetooth (everything fails with some 'bluetooth' message on the watch face)
- when i go to the menus i get an extra 'updating boot0' screen between each menus
- the clock now does not use the timezones anymore
i tried to reflash the firmware going into dfu mode with the android app
and i think it went succesfullybut still, the watch did not go back to life.
this is a brand new watch i bought a few days ago.
anyone met something like that ? any way to reset the watch ?
help ?
- no bluetooth (everything fails with some 'bluetooth' message on the watch face)
so a small message to confirm that you were right. reusing the buffers all performance issues disappear.
thanks again for the tip.