Keep an eye on those revision descriptions.
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Optimize jj log generation via async execution and caching #1

open opened by nikosavola.tngl.sh targeting main from nikosavola.tngl.sh/jj-log.nvim: push-mutrvkplpysr

This PR significantly improves the performance of jj-log.nvim by reducing synchronous blocking operations and optimizing how often the jj log subprocess is spawned.

Key Optimizations#

  • Replaced synchronous file I/O checks: Swapped the blocking vim.fn.filereadable() with a quick check on the buffer type (vim.bo.buftype). The plugin now naturally ignores unbacked buffers (terminals, help files, etc.) without hitting the disk.
  • Directory Caching: Refactored .jj repository detection into a new helpers.lua module. The upward directory traversal now utilizes non-blocking vim.uv.fs_stat and caches all intermediate directories.
  • Subprocess Debouncing: Implemented a per-repository lock to prevent the plugin from spawning overlapping jj log shell commands if multiple autocommands fire concurrently.
  • Command Output Caching: Added a description cache (cache_timeout_ms, defaulting to 2 seconds). Subsequent buffer events within this window will immediately return the cached string rather than spinning up a new shell process.
  • Synchronized Split/Tab Updates: When the async jj log command finishes, the plugin now updates vim.b.jj_desc for all valid open buffers belonging to that repository simultaneously, ensuring status lines stay perfectly in sync.
  • Graceful Failures: Wrapped Neovim API calls in pcall() so the plugin fails safely if a buffer is closed before the async shell command completes.
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:2aeioyq3tv4brcuypgqqzobm/sh.tangled.repo.pull/3mjosp7voxb22
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments