Skip to content
Skills Library
Programming · Building & coding

lazy-loading

/lazy-loading

Defer expensive work until the moment it is actually needed, so startup stays fast and unused paths cost nothing. Use when initialization is slow, a page ships code it never runs, or a list renders far more rows than the screen shows.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Defer expensive work until the moment it is actually needed, so startup stays fast and unused paths cost nothing. Use when initialization is slow, a page ships code it never runs, or a list renders far more rows than the screen shows.

Original author description

Defer expensive work until the moment it is actually needed, so startup stays fast and unused paths cost nothing. Use when initialization is slow, a page ships code it never runs, or a list renders far more rows than the screen shows.

How it works

  1. Method
  2. Litmus tests
  3. Boundaries
Original SKILL.md headings · 50 lines, 420 words
SKILL.md preview
---
name: lazy-loading
description: Defer expensive work until the moment it is actually needed, so startup stays fast and unused paths cost nothing. Use when initialization is slow, a page ships code it never runs, or a list renders far more rows than the screen shows.
---

# Lazy loading

Most programs do work up front that a given run never uses: constructing objects
nobody touches, parsing config for a path not taken, rendering list rows
off-screen, shipping a bundle for a route never visited. Deferring that work
trades a tiny check at use-time for a large saving at start-time. The craft is
deferring without turning it into a stall on the first call.

## Method

1. **Measure where startup and first paint go.** Profile boot and cold render: a
   flame graph of initialization, a bundle analyzer (`webpack-bundle-analyzer`,
   `source-map-explorer`), a Lighthouse trace. Defer the biggest unconditional
   cost, not whatever is easiest to wrap.
2. **Lazily initialize expensive singletons.** Build a heavy client, connection,
   or parsed table on first access, not at import. Use a memoized getter
   (`functools.cached_property`, a `lazy` holder, `sync.Once`) so the cost is
   paid once, only if something uses it, and never at module load.
3. **Split code along route and interaction seams.** Dynamic-import a route's
   bundle, a modal, or a heavy widget so the initial download carries only what
   the first screen needs. In React that is `React.lazy` with `Suspense`; in a
   bundler, a dynamic `import()` marks the split point.
4. **Virtualize long lists.** Render only the rows in and near the viewport with
   `react-window`, `react-virtualized`, or a `<virtual-scroller>`, recycling DOM
   nodes as the user scrolls. A 10,000-row table then costs the twenty-odd
   visible rows, not all of them.
5. **Defer off-screen media and data.** Add `loading="lazy"` to below-the-fold
   images and iframes, and fetch a tab or panel's data when it opens, not on
   page load. Prefetch on hover or intent so the deferred cost lands before the
   user notices it.
6. **Guard against the lazy stall and the waterfall.** A defer that runs a heavy
   synchronous load on first interaction just relocates the jank. Show a
   placeholder, load in the background, and avoid chains where each lazy step
   waits on the previous one before it even starts fetching.

## Litmus tests

- Does deferred work stay uncomputed on a run that never triggers it?
- Did the initial bundle or startup cost fall by the deferred amount?
- On first use of a lazy path, is there a placeholder rather than a freeze?
- Does a virtualized list's cost stay flat as the row count grows?

## Boundaries

This defers work until it is needed. Deciding what to precompute and keep warm
instead is caching-strategy; coalescing many deferred triggers into one is
batching-and-debouncing. Framework-specific suspense and hydration rules follow
that framework's own contract.

Versions

RepositoryScoreLicence
This page · Amey-Thakur/AI-SKILLS90MIT
thedaviddias/front-end-checklist100MIT

Database snapshot: 13.11.2026 · package version 5dd87eaeac64 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100lazy-loading-implementer
    Execute lazy loading implementer operations. Auto-activating skill for Frontend Development. Triggers on: lazy loading implementer, lazy loading implementer Part of the Frontend Development skill category. Use when working with lazy loading implementer functionality. Trigger…
  • 100lazy-nvim-optimization
    Profiles Neovim startup performance and optimizes lazy.nvim plugin loading with targeted lazy-loading specs, priorities, and event triggers. Contains profiling workflow and bottleneck checklists. Make sure to use this skill whenever the user mentions slow neovim startup, neovim…
  • 100angular-architecture
    Standards for Angular project structure, feature modules, and lazy loading. Use when structuring Angular apps, defining feature modules, or configuring lazy loading.
  • 100bundle-analyzer
    JavaScript/TypeScript bundle size analysis, tree-shaking audit, and code splitting recommendations. Identifies heavy dependencies, duplicate packages, unused imports, and suggests dynamic imports and lazy loading. Use when bundle is too large, Lighthouse score is low, or user…
  • 100react
    Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization. Use when working with React components, hooks, lazy loading, Suspense boundaries, or React-specific TypeScript patterns.
  • 100flutter-startup-network-blocking
    Fix slow Flutter app startup caused by blocking network operations during initialization. Use when: (1) App takes several seconds to show first frame, (2) Startup logs show sequential network operations (WebSocket connections, API calls), (3) Services initialize during startup…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.