Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rendering speed by introducing dynamic MapTree cache (+Show cities in iOS) #21052

Closed
vshcherb opened this issue Oct 15, 2024 · 3 comments · May be fixed by osmandapp/OsmAnd-core#799
Closed
Assignees

Comments

@vshcherb
Copy link
Member

vshcherb commented Oct 15, 2024

  • Today when we render the file we only use static cache using High level MapTree (top level)
  • This leads that every time for tile whole map section scanned (i.e. reading header, skipping bytes, reading another header, skipping bytes...)
  • Instead we could introduce MapTree cache, so once Header read it's stored in cache and next neighboor tile rendering will use that cache and operate this can in Memory
  • This should increase performance dramatically on low I/O reading devices (where skip is not efficient)

Spillover

Challenges

  • We use multithreading so we should caches roughly 1 per each thread (it's ok to have copy of caches than concurrent collections)
  • We need to reuse these caches (so pool is needed)
  • This cache is needed for search as well, so every next search will work faster
@vshcherb vshcherb added this to the 4.9-map milestone Oct 15, 2024
@vshcherb vshcherb changed the title Improve rendering speed by introducing dynamic MapTree cache Improve rendering speed by introducing dynamic MapTree cache (+Show cities in iOS) Oct 16, 2024
@vshcherb
Copy link
Member Author

@vshcherb
Copy link
Member Author

vshcherb commented Nov 5, 2024

@vshcherb vshcherb modified the milestones: 4.9-map, 4.9-backend Nov 5, 2024
@vshcherb vshcherb removed this from the 4.9-backend milestone Nov 18, 2024
@vshcherb vshcherb closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@vshcherb
Copy link
Member Author

Testing results show no big improvement

Cache 7 depth
0.277 sec, 222 blocks total 1 858 560 bytes - 20821 objects
0.030 sec, 68 blocks total 988 160 bytes - 20821 objects
0.028 sec, 68 blocks total 988 160 bytes - 20821 objects
0.029 sec, 68 blocks total 988 160 bytes - 20821 objects

No Cache
0.278 sec, 222 blocks total 1 858 560 bytes - 20821 objects
0.033 sec, 215 blocks total 1 740 800 bytes - 20821 objects
0.031 sec, 215 blocks total 1 740 800 bytes - 20821 objects
0.033 sec, 215 blocks total 1 740 800 bytes - 20821 objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants