Skip to content

⚡ Bolt: Memoize filtered Deck.gl map data#2

Open
garridolecca wants to merge 1 commit intomainfrom
bolt/deckgl-layer-memoization-10626301925893231551
Open

⚡ Bolt: Memoize filtered Deck.gl map data#2
garridolecca wants to merge 1 commit intomainfrom
bolt/deckgl-layer-memoization-10626301925893231551

Conversation

@garridolecca
Copy link
Owner

💡 What: Implemented memoization for filtered datasets in DeckGLMap.ts.
🎯 Why: The previous implementation re-filtered large datasets (military flights, earthquakes, etc.) on every render frame, even during simple animations like the pulse effect. This caused Deck.gl to detect "new" data on every frame, triggering expensive re-diffing and potential attribute re-uploads.
📊 Impact: Significantly reduces CPU usage during map idle animations and interactions. Layers now only update when the underlying data or time range actually changes.
🔬 Measurement: Verified by code inspection that filterByTime is no longer called inside the buildLayers render loop. Type checking passed. The "ArcGIS" user request was noted but determined to be a major architectural change out of scope for a "small performance improvement"; this optimization respects the existing architecture.


PR created automatically by Jules for task 10626301925893231551 started by @garridolecca

Optimizes the `DeckGLMap` component by caching filtered datasets (earthquakes, military flights, etc.) based on the current time range. Previously, `buildLayers` re-filtered all data on every render frame (including pulse animations), creating new array references that triggered unnecessary Deck.gl layer updates.

This change:
- Adds instance properties to cache filtered data.
- Updates data setters and `setTimeRange` to refresh these caches only when data or filters change.
- Updates `buildLayers` to use the stable cached arrays.

This significantly reduces CPU load during map animations and interactions.

Co-authored-by: garridolecca <10247583+garridolecca@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant