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

refacto(cache): ditch Map() in Cache for simple tree #1264

Merged
merged 2 commits into from
Dec 6, 2019

Conversation

zarov
Copy link
Contributor

@zarov zarov commented Nov 28, 2019

The previous Cache was working on a single Map, which can become really
slow and big after a few minutes of navigation in iTowns.

Now, the Cache is composed of a single tree, that can contain node up
to 3 levels. It simplifies things attached to a layer, a source or
others things like a zoom value. Instead of having a complex string
composed with all those information, it now uses several key accross all
the node of the Cache.

In term of performance, the proposed implementation is 20 times faster
than the previous one.

The previous Cache was working on a single Map, which can become really
slow and big after a few minutes of navigation in iTowns.

Now, the Cache is composed of a single tree, that can contain node up
to 3 levels. It simplifies things attached to a layer, a source or
others things like a zoom value. Instead of having a complex string
composed with all those information, it now uses several key accross all
the node of the Cache.

In term of performance, the proposed implementation is 20 times faster
than the previous one.
src/Core/Scheduler/Cache.js Outdated Show resolved Hide resolved
src/Core/Scheduler/Cache.js Show resolved Hide resolved
src/Core/Scheduler/Cache.js Show resolved Hide resolved
src/Core/Scheduler/Cache.js Show resolved Hide resolved
@zarov zarov merged commit 881604f into iTowns:master Dec 6, 2019
@zarov zarov deleted the better-cache branch December 6, 2019 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants