aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorPablo Arias <pabloariasal@gmail.com>2024-02-09 23:56:52 +0100
committerGitHub <noreply@github.com>2024-02-09 14:56:52 -0800
commit8e739af064dec28886694aa448f60a570acd2173 (patch)
treeb7155ba07b696607a86bb9355a9af1cb41d26df9 /src/nvim/normal.c
parent3f419d84fbb918836fd90f2e09eace7ce3266f6b (diff)
downloadrneovim-8e739af064dec28886694aa448f60a570acd2173.tar.gz
rneovim-8e739af064dec28886694aa448f60a570acd2173.tar.bz2
rneovim-8e739af064dec28886694aa448f60a570acd2173.zip
fix(startup): multiprocess startuptime #26790
Problem: Since 24488169564c39a506c235bf6a33b8e23a8cb528, the --startuptime report shows two blocks of data. The TUI process and its embedded nvim process write to the file concurrently, which may interleave the two startup sequences into the same timeline. Solution: Report each process as a separate section in the same file. 1. Each process buffers the full report. 2. After startup is finished, the buffer is flushed (appended) to the file. Fix #23036 Sample report: --- Startup times for process: Primary/TUI --- times in msec clock self+sourced self: sourced script clock elapsed: other lines 000.006 000.006: --- NVIM STARTING --- 000.428 000.422: event init 000.728 000.301: early init ... 005.880 000.713: init highlight 005.882 000.002: --- NVIM STARTED --- --- Startup times for process: Embedded --- times in msec clock self+sourced self: sourced script clock elapsed: other lines 000.006 000.006: --- NVIM STARTING --- 000.409 000.403: event init 000.557 000.148: early init 000.633 000.077: locale set ... 014.383 000.430: first screen update 014.387 000.003: --- NVIM STARTED ---
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 9966e6129c..8b6ef62873 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1451,9 +1451,7 @@ static int normal_check(VimState *state)
// has been done, close any file for startup messages.
if (time_fd != NULL) {
TIME_MSG("first screen update");
- TIME_MSG("--- NVIM STARTED ---");
- fclose(time_fd);
- time_fd = NULL;
+ time_finish();
}
// After the first screen update may start triggering WinScrolled
// autocmd events. Store all the scroll positions and sizes now.