Skip to content

refactor: new code structure, live TUI layout and configurable refresh interval#77

Merged
Loongphy merged 20 commits intomainfrom
codex/zigzag-align
Apr 27, 2026
Merged

refactor: new code structure, live TUI layout and configurable refresh interval#77
Loongphy merged 20 commits intomainfrom
codex/zigzag-align

Conversation

@Loongphy
Copy link
Copy Markdown
Owner

@Loongphy Loongphy commented Apr 27, 2026

  1. Refactor code organization structure.

  2. Optimize live table rendering performance.

  3. Align list --live, switch --live, and remove --live table rendering.

  4. Add configurable live refresh interval for API/local data refresh.

  5. Integrate foreground auto-switch into switch --live by default; the removed --auto flag is no longer needed.

TUI Performance

Benchmark: list --live --skip-api, PTY size 120x28, synthetic registries with 10/50/100/500 accounts.
CPU and RSS are sampled from /proc/<pid>. Write counts are syscall-level counts from strace -f -e trace=write,writev,pwrite64,pwritev.

Startup First Frame

Accounts Rank Implementation Output write calls CPU Peak RSS Notes
10 1 current 1.2 KB 4 0 ms 3.4 MB Small lists are basically tied.
10 2 main 1.2 KB 3 0 ms 3.4 MB Small lists are basically tied.
50 1 current 2.7 KB 4 0 ms 3.5 MB Viewport-sized output.
50 2 main 5.2 KB 4 0 ms 3.6 MB Writes the whole table.
100 1 current 2.7 KB 4 0 ms 3.5 MB Stable output size.
100 2 main 10.3 KB 5 10 ms 3.5 MB Grows with account count.
500 1 current 2.7 KB 4 10 ms 5.9 MB Stable output size.
500 2 main 50.5 KB 15 10 ms 5.1 MB Writes much more on startup.

Idle Tick, 3 Seconds

Accounts Rank Implementation Output write calls full clear CPU Notes
10 1 current 2.4 KB 2 0 0 ms No full clear.
10 2 main 3.6 KB 3 3 0 ms Still clears while idle.
50 1 current 5.3 KB 2 0 0 ms Fixed viewport output.
50 2 main 15.5 KB 6 3 0 ms Grows with list size.
100 1 current 5.4 KB 2 0 0 ms Stable.
100 2 main 30.8 KB 9 3 0 ms Writes the full table while idle.
500 1 current 5.4 KB 3 0 10 ms Stable.
500 2 main 151.5 KB 39 3 0 ms Much higher terminal pressure while idle.

Continuous Row Scroll, 100 Down Inputs

Accounts Rank Implementation Output write calls CPU Peak RSS Notes
10 1 current 24.3 KB 20 10 ms 3.4 MB Writes less after reaching list bounds.
10 2 main 119.1 KB 100 0 ms 3.7 MB Redraws every input.
50 1 current 60.8 KB 24 0 ms 3.5 MB Lower output volume.
50 2 main 517.6 KB 200 10 ms 4.3 MB Higher terminal pressure.
100 1 current 74.7 KB 28 0 ms 3.7 MB Lower output volume.
100 2 main 1,025.5 KB 300 30 ms 6.8 MB Full-table redraw behavior.
500 1 current 181.4 KB 68 0 ms 5.7 MB Viewport-level scroll output.
500 2 main 5,048.9 KB 1,300 120 ms 11.2 MB About 27.9x more output.

Page Scroll, 20 PageDown Inputs

Accounts Rank Implementation Output write calls CPU Notes
10 1 current 4.9 KB 4 0 ms Writes less after reaching list bounds.
10 2 main 23.8 KB 20 0 ms Redraws every input.
50 1 current 10.6 KB 4 0 ms Much lower output volume.
50 2 main 103.5 KB 40 0 ms Writes the whole table.
100 1 current 16.0 KB 6 0 ms Fewer write calls.
100 2 main 205.1 KB 60 10 ms High output volume.
500 1 current 50.7 KB 19 0 ms Viewport-level page output.
500 2 main 1,009.8 KB 260 20 ms About 19.9x more output.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@77

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@77

@loongphy/codex-auth-linux-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-arm64@77

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@77

@loongphy/codex-auth-win32-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-arm64@77

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@77

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@77

commit: 8742eca

@Loongphy Loongphy changed the title Refactor live TUI layout and configurable refresh interval refactor: new code structure, live TUI layout and configurable refresh interval Apr 27, 2026
@Loongphy Loongphy merged commit 284fc1c into main Apr 27, 2026
11 checks passed
@Loongphy Loongphy deleted the codex/zigzag-align branch April 27, 2026 12:28
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.

1 participant