tmux-python / tmux-python/tmuxp

Very slow performance opening layouts/workspaces

Open
#1,053 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.6k
Forks
248
Avg merge
2h 13m
Merged PRs (30d)
1

Description

I used to use this project a while ago, recently I wanted to incorporate it again in a few of my scripts but it seems like opening layouts takes a significant amount of time.

Simple layouts (2 windows where 1 window is a split pane with simple commands prefilled) can take several seconds to open. It seems to linearly scale with the amount of windows as well.
This feels like something that should take milliseconds, not seconds.

Here is an extreme example of a workspace that took 25 seconds!

✓ Loaded workspace: work/haystack (~/.config/tmux-layouts/projects/work/haystack/layout.yaml) [12 win, 18 panes]
Session created in detached state.
[detached (from session work/haystack)]

~ took 25s

Repeat the following windows 6 times (for 12 total windows) and you've got the layout from above:

session_name: ${SESSION_NAME}
start_directory: ${PROJECT_DIR}
windows:
    - window_name: Editor
      layout: main-vertical
      focus: true
      options:
          main-pane-width: 75%
      panes:
          - shell_command: nvim
            focus: true
          - null

    - panes:
          - null

It's especially jarring because I feel like it definitely did not take this long with a version from months ago, though I can't say that with certainty.

This project so far does provide the most flexibility and features that I'd like to have, so thanks for the effort! <3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the delay with the provided layout.yaml example, repeating its two-window pattern to reach 12 windows and 18 panes. Trace the workspace-opening entry point and measure where startup time is spent; done means the example opens substantially faster without changing its resulting layout, with a regression check for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.