configuring-lazy-prefetch

Configures Jetpack Compose lazy-layout prefetch windows and nested prefetch to reduce scroll jank.

1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill configuring-lazy-prefetch-citytexi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: configuring-lazy-prefetch
Source: https://github.com/citytexi/team-yg-pesonal-agent/tree/main/.claude/skills/configuring-lazy-prefetch
Command: npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill configuring-lazy-prefetch-citytexi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Heavy lazy lists in Jetpack Compose drop frames at high scroll velocity because items are composed too late or prefetch work piles into a single frame. This Skill guides you through measuring the bottleneck with Macrobenchmark and tuning prefetch behavior only when the data justifies it. ## Core Features & Use Cases - Cache Window Tuning: Configure Dp-based ahead/behind extents with LazyLayoutCacheWindow (Compose Foundation 1.9+) plumbed through rememberLazyListState. - Pausable Prefetch Guidance: Leverage Compose Foundation 1.10+ pausable composition defaults before manually widening windows. - Nested Prefetch: Implement NestedPrefetchScope so inner lazy layouts (HorizontalPager inside LazyColumn rows) compose during the outer prefetch slot. - Use Case: Your image-heavy feed shows p99 frame spikes in Macrobenchmark FrameTimingMetric. This Skill walks you through verifying item-level hygiene, measuring a baseline, applying a narrow cache window, and re-measuring to confirm the improvement. ## Quick Start Ask the AI to diagnose dropped frames in your LazyColumn and configure a LazyLayoutCacheWindow with Macrobenchmark validation.

Frequently Asked Questions about configuring-lazy-prefetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure LazyLayoutCacheWindow in Jetpack Compose?▼

Create the window with the LazyLayoutCacheWindow(ahead: Dp, behind: Dp) factory and pass it through rememberLazyListState(cacheWindow = ...), then give that state to LazyColumn. It requires Compose Foundation 1.9+ and @OptIn(ExperimentalFoundationApi::class) at every call site.

How to fix dropped frames when scrolling a LazyColumn fast?▼

First measure with Macrobenchmark FrameTimingMetric on a release build with R8 on a real device. Ensure items have stable keys and contentType, then widen the prefetch cache window only if composition is the confirmed bottleneck.

Does LazyLayoutCacheWindow work as a LazyColumn parameter?▼

No, the cache window is not a parameter on LazyColumn, LazyRow, or the grid composables. It must be plumbed through rememberLazyListState(cacheWindow = ...) or the equivalent grid state factory, then passed via the state parameter.

What Compose Foundation version supports pausable prefetch composition?▼

Pausable composition in prefetch is enabled by default in Compose Foundation 1.10+. The prefetch composer can suspend mid-item near the frame deadline and resume on the next idle frame, so upgrading is preferred before manually tuning windows.

When should I not widen the prefetch cache window?▼

Avoid widening when items are cheap, when item composables are non-skippable or unstable, or when measure/draw dominates rather than composition. Wide windows raise memory pressure and waste prefetched work on direction reversals without fixing the root cause.

Why does the first horizontal swipe stutter inside a LazyColumn row?▼

The outer prefetch only warms the row's outer composition, so the inner HorizontalPager's first page composes on the user's first swipe. Implement NestedPrefetchScope so the inner layout's first item composes during the outer prefetch slot.