Skip the decode and the texture upload for a tile that was aborted

Open
#879 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
performance

Research direction

Start with the default getTileData path and the pool.decode call referenced by the linked issue #876; check the repository for their file locations and existing cancellation handling. Consider both suggested signal checks, then verify that an aborted tile skips queued decoding and texture creation without triggering onError; the issue says neither approach has been measured.

Written by the indexing model from the issue text.

Description

[!NOTE]
This issue was written by Claude (Claude Code), not by @kylebarron.

Split out of #876, which is about the texture leak that #878 fixes. This is the work that is left once the leak is gone.

Problem

When a tile is aborted after its bytes have arrived, the rest of its load still runs:

  1. The decode finishes, because pool.decode takes no signal.
  2. The default getTileData doesn't check signal before device.createTexture, so the texture is created and uploaded on the main thread.

With #878, that texture is freed as soon as the load finishes. So nothing leaks, but the decode and the upload are wasted, at the moment the app is busiest: a fast pan or zoom over many small tiles.

Possible fixes

Both are from #876, which links to the lines:

  • Check the signal before creating textures in the default getTileData, with signal?.throwIfAborted() after fetchTile resolves. deck.gl treats a cancelled tile that returns no data as not loaded, with no onError.
  • Pass signal into pool.decode, so a decode still in the queue is skipped. That saves worker time as well.

Neither has been measured.

🤖 Written by Claude Code

Dominant language
TypeScript
Stars
240
Forks
34
Avg merge
17h 24m
Merged PRs (30d)
62

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/deck.gl-raster

All issues in developmentseed/deck.gl-raster

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.