Avatar for wagnerf42

wagnerf42

Member since Jul 2022 • Last active Nov 2023
  • 5 conversations
  • 21 comments

Most recent activity

  • in Bangle.js
    Avatar for wagnerf42

    so a small message to confirm that you were right. reusing the buffers all performance issues disappear.

    thanks again for the tip.

  • in Bangle.js
    Avatar for wagnerf42

    hi, yes that should be it. the memory usage is very high.
    i think i should be able to allocate at start and reuse the buffers.
    i need to change a bit of code but it should be ok.

    thanks a lot! i'll give it a try this week end and post the result here

  • in Bangle.js
    Avatar for wagnerf42

    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 ?

  • in Bangle.js
    Avatar for wagnerf42

    i gave a try building a small example from scratch but it did not work. so i guess i'll need to start from the full code and trim it. that'll take some time though.

  • in Bangle.js
    Avatar for wagnerf42

    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.

  • in Bangle.js
    Avatar for wagnerf42

    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.

  • in Bangle.js
    Avatar for wagnerf42

    no, that's just the cpu the algorithms take to draw the map (and figure where you are if lost).
    i'm speaking about the cutting edge version in the git which encounters a bug.

  • in Bangle.js
    Avatar for wagnerf42

    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.

Actions