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

replace Cache by Lru cache #2451

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
steps:

# Use specific Node.js version
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
cache: 'npm'

# Install packages
Expand Down Expand Up @@ -84,11 +84,11 @@ jobs:
steps:

# Use specific Node.js version
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
cache: 'npm'

# Install packages
Expand All @@ -114,11 +114,11 @@ jobs:
steps:

# Use specific Node.js version
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
cache: 'npm'

# Install packages
Expand Down Expand Up @@ -149,15 +149,15 @@ jobs:
contents: write
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch all branches
fetch-depth: 0

# Configure git user for later command induced commits
- uses: fregante/setup-git-user@v1

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand Down Expand Up @@ -261,12 +261,12 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x

- name: Message commit
run: echo "is RELEASE => ${{ github.event.head_commit.message }} !!"
Expand Down
34 changes: 20 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"copc": "^0.0.6",
"earcut": "^3.0.0",
"js-priority-queue": "^0.1.5",
"lru-cache": "^11.0.1",
"pbf": "^4.0.1",
"shpjs": "^6.1.0",
"threads": "^1.7.0"
Expand Down
3 changes: 0 additions & 3 deletions src/Core/MainLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function updateElements(context, geometryLayer, elements) {
for (const attachedLayer of geometryLayer.attachedLayers) {
if (attachedLayer.ready) {
attachedLayer.update(context, attachedLayer, sub.element, sub.parent);
attachedLayer.cache.flush();
}
}
} else if (sub.elements) {
Expand All @@ -67,7 +66,6 @@ function updateElements(context, geometryLayer, elements) {
for (const attachedLayer of geometryLayer.attachedLayers) {
if (attachedLayer.ready) {
attachedLayer.update(context, attachedLayer, sub.elements[i], sub.parent);
attachedLayer.cache.flush();
}
}
}
Expand Down Expand Up @@ -161,7 +159,6 @@ class MainLoop extends EventDispatcher {
}

// Clear the cache of expired resources
geometryLayer.cache.flush();

view.execFrameRequesters(MAIN_LOOP_EVENTS.AFTER_LAYER_UPDATE, dt, this.#updateLoopRestarted, geometryLayer);
}
Expand Down
Loading
Loading