Agent skill · software engineering · jeremylongshore

obsidian-performance-tuning

Optimize Obsidian plugin performance for smooth operation in large vaults.

Why this skill is useful

Provides specific performance optimization techniques and code snippets for Obsidian plugins that the AI wouldn't reliably generate on its own.

What it needs

Requires npm installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Obsidian Performance Tuning Overview Optimize Obsidian plugin performance for large vaults (10,000+ files): profile bottlenecks with DevTools, implement lazy initialization, process files in batches with UI yielding, use LRU caches with bounded memory, debounce event handlers, and optimize DOM rendering with virtual scrolling and DocumentFragment. Prerequisites Working Obsidian plugin with at least one performance concern Developer Console access (Ctrl+Shift+I / Cmd+Option+I) Understanding of async JavaScript and the event loop Performance Benchmarks Metric Good Warning Critical -------- ------ --------- ---------- Plugin load time (onload) < 100ms 100-500ms > 500ms Command execution < 50ms 50-200ms > 200ms Single file operation < 10ms 10-50ms > 50ms Memory increase on load < 10MB 10-50MB > 50MB Event handler execution < 5ms 5-20ms > 20ms Instructions Step 1: Profile with DevTools Performance Tab For deeper analysis, use the DevTools Performance tab: 1. Open DevTools (Ctrl+Shift+I) 2. Go to Performance tab 3. Click Record 4. Toggle your plugin off/on in Settings > Community Plugins 5. Stop recording 6. Look for long tasks (yellow bars > 50ms) in the flame chart Step 2: Lazy Initialization — Defer Expensive Work Step 3: Batch File Processing with UI Yielding Step 4: LRU Cache for Bounded Memory Step 5: Debounce and Throttle Event Handlers Step 6: Optimize DOM Rendering Step 7: Memory Leak Prevention Output Performance profiler identifying specific bottlenecks in onload and commands Lazy initialization deferring index builds until first use Batch file processing with await sleep(0) yielding to prevent UI freezes LRU cache with bounded memory (500 entries) and mtime-based invalidation Debounced event handlers (global and per-file) for vault.on('modify') DOM optimization with DocumentFragment, requestAnimationFrame, and virtual scrolling Memory leak prevention checklist with WeakMap, registerEvent, registerInterval Error Handling Issue Cause Solution ------- ------- --- …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/obsidian-performance-tuning

View the source on GitHub

Browse the @skills marketplace