Skip to content

perf: optimize cursor loading by deferring heavy operations - #98

Closed
kanetronv2 wants to merge 1 commit into
mainfrom
claude/issue-86-20250529_224726
Closed

kanetronv2 wants to merge 1 commit into
mainfrom
claude/issue-86-20250529_224726

Conversation

@kanetronv2

Copy link
Copy Markdown
Contributor

Fixes #86

Optimizes cursor loading performance by deferring heavy operations that were blocking the main thread during terminal initialization.

Changes:

  • Move ASCII art and file preloading after terminal initialization
  • Process images in batches with delays to prevent blocking main thread
  • Load remote files asynchronously with staggered timing
  • Add lazy loading fallback for ASCII art on-demand

This allows the terminal cursor to become responsive immediately while background assets load progressively.

Generated with Claude Code

- Move ASCII art and file preloading after terminal initialization
- Process images in batches with delays to prevent blocking main thread  
- Load remote files asynchronously with staggered timing
- Add lazy loading fallback for ASCII art on-demand
- Resolves slow cursor loading issue #86

Co-authored-by: kanetronv2 <kanetronv2@users.noreply.github.com>
@ledwards

Copy link
Copy Markdown
Contributor

The diagnosis was right, and the fix landed — just via a different route.

#109 ("Improve terminal startup interactivity") restructured the same startup path: preloadASCIIArt() and preloadFiles() now run inside window.scheduleIdleTask(...) from js/bootstrap.js, so they yield to the browser instead of blocking first paint. That uses requestIdleCallback rather than a chain of staggered setTimeouts, which gets the same "don't block interactivity" result without guessing at delays.

Reported improvements from that work: homepage prompt visible 1941ms → 70ms, first command rendered 2076ms → 223ms.

The PR conflicts against the rewritten files and there's nothing left in it to port, but this was the correct read of the problem.

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.

the cursor loads too slowly

2 participants