Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 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
filterByTimeis no longer called inside thebuildLayersrender 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