extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.51k stars 571 forks source link

Gitui slow start-up #1239

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug I have a repository where the start-up of gitui is slow.

To Reproduce Unfortunately I cannot share the repository because it is confidential.

Expected behavior Fast start-up

Screenshots gitui

Context: gitui v0.20.1 installed via homebrew MacOS 12.3.1 on a MacBook Pro Apple M1

Additional context This repo is quite huge and has also a lot of submodules and sub-submodules

ghost commented 2 years ago

As mentioned here https://github.com/extrawurst/gitui/issues/976#issuecomment-964727073 I also run a build with timing build and here is the log file:

11:26:23 [TRACE] (6) mio::poll: [/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/poll.rs:478] registering event source with poller: token=Token(0), interests=READABLE
11:26:23 [TRACE] (1) gitui::app: [src/app.rs:421] update
11:26:23 [TRACE] (6) mio::poll: [/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/poll.rs:478] registering event source with poller: token=Token(1), interests=READABLE
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::utils::get_head_repo] @asyncgit/src/sync/utils.rs:82
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 6 ms [asyncgit::sync::branch::get_branch_name_repo] @asyncgit/src/sync/branch/mod.rs:34
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::utils::get_head_repo] @asyncgit/src/sync/utils.rs:82
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::branch::get_branch_name_repo] @asyncgit/src/sync/branch/mod.rs:34
11:26:23 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 9454028357347955431] (type: WorkingDir)
11:26:23 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 8563758401019419022] (type: Stage)
11:26:23 [TRACE] (2) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::config::get_config_string_repo] @asyncgit/src/sync/config.rs:80
11:26:23 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::config::get_config_string_repo] @asyncgit/src/sync/config.rs:80
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::state::repo_state] @asyncgit/src/sync/state.rs:38
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 1 ms [asyncgit::sync::branch::branch_compare_upstream] @asyncgit/src/sync/branch/mod.rs:251
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 10 ms [gitui::loop] @src/main.rs:172
11:26:23 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 15 ms [asyncgit::sync::status::get_status] @asyncgit/src/sync/status.rs:135
11:26:23 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 8563758401019419022 (type: Stage)
11:26:23 [TRACE] (1) gitui::app: [src/app.rs:440] update_async: Git(Status)
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 14 ms [asyncgit::sync::branch::get_branches_info] @asyncgit/src/sync/branch/mod.rs:118
11:26:23 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 14 ms [gitui::loop] @src/main.rs:172
11:26:28 [TRACE] (1) gitui::app: [src/app.rs:421] update
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::utils::get_head_repo] @asyncgit/src/sync/utils.rs:82
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::utils::get_head_repo] @asyncgit/src/sync/utils.rs:82
11:26:28 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:96] request blocked, still pending
11:26:28 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 2356003438891540638] (type: Stage)
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::state::repo_state] @asyncgit/src/sync/state.rs:38
11:26:28 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::config::get_config_string_repo] @asyncgit/src/sync/config.rs:80
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [asyncgit::sync::branch::branch_compare_upstream] @asyncgit/src/sync/branch/mod.rs:251
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 1 ms [gitui::loop] @src/main.rs:172
11:26:28 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 2 ms [asyncgit::sync::status::get_status] @asyncgit/src/sync/status.rs:135
11:26:28 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 2356003438891540638 (type: Stage)
11:26:28 [TRACE] (1) gitui::app: [src/app.rs:440] update_async: Git(Status)
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 3 ms [asyncgit::sync::branch::get_branches_info] @asyncgit/src/sync/branch/mod.rs:118
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 4 ms [gitui::loop] @src/main.rs:172
11:26:28 [TRACE] (2) scopetime: [scopetime/src/lib.rs:41] scopetime: 5058 ms [asyncgit::sync::status::get_status] @asyncgit/src/sync/status.rs:135
11:26:28 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 9454028357347955431 (type: WorkingDir)
11:26:28 [TRACE] (1) gitui::app: [src/app.rs:440] update_async: Git(Status)
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 3 ms [asyncgit::sync::branch::get_branches_info] @asyncgit/src/sync/branch/mod.rs:118
11:26:28 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 4 ms [gitui::loop] @src/main.rs:172
11:26:30 [TRACE] (1) gitui::app: [src/app.rs:345] event: Input(Key(KeyEvent { code: Char('q'), modifiers: NONE }))
11:26:30 [TRACE] (1) scopetime: [scopetime/src/lib.rs:41] scopetime: 0 ms [gitui::loop] @src/main.rs:172
extrawurst commented 2 years ago

probably a duplicate of https://github.com/extrawurst/gitui/issues/523 otherwise feel free to reopen

extrawurst commented 2 years ago

please checkout https://github.com/extrawurst/gitui/pull/1310