Giter Site home page Giter Site logo

Moving a way is very laggy about gomap HOT 5 CLOSED

Alex-Vasile avatar Alex-Vasile commented on August 15, 2024
Moving a way is very laggy

from gomap.

Comments (5)

bryceco avatar bryceco commented on August 15, 2024 1

Thanks for the nudge, it really helped to get me to reevaluate the approach!

from gomap.

bryceco avatar bryceco commented on August 15, 2024

This is a long-standing issue. The root cause is because we recompute the quad-tree for every entity that contains the nodes in the way, and we don't have a index of objects containing the node so we iterate over all objects to see what needs to be updated.

From a user perspective the solution is to clear the cache so we have fewer objects to iterate over.

I'm working on an update where we track parents of nodes, which is more fragile during edits.

from gomap.

Alex-Vasile avatar Alex-Vasile commented on August 15, 2024

When you say "we iterate over all objects", do you literally mean all cached objects?

Would it be possible to do some spatial partitioning for the caching and searching so the max workload is dictated by the partition size (a constant) rather than the cache size?

Sorry if that's naive and you already do that, I haven't taken a dive into the code base yet.

from gomap.

bryceco avatar bryceco commented on August 15, 2024

Yes it really is all objects (or all ways). I agree it would be smarter (and not too much code) to only look at the ways that are currently displayed on screen, which we can grab from the shownObjects array.

from gomap.

Alex-Vasile avatar Alex-Vasile commented on August 15, 2024

Just tried out on TestFlight. Works beautifully!

from gomap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.