From 5f30ccfbc3f560520c8eae50d7fbf138cdf4d0da Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 29 Jul 2023 09:32:58 +1000 Subject: [PATCH] Log duration of post-refresh-update call Notably, the reflog view is taking ages here because it's got a few thousand lines to write to the view. In future we should only populate the view's viewport. --- pkg/gui/view_helpers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 85ec21128..58c973712 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -1,6 +1,8 @@ package gui import ( + "time" + "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/tasks" @@ -129,6 +131,11 @@ func (gui *Gui) render() { // if the context's view is set to another context we do nothing. // if the context's view is the current view we trigger a focus; re-selecting the current item. func (gui *Gui) postRefreshUpdate(c types.Context) error { + t := time.Now() + defer func() { + gui.Log.Infof("postRefreshUpdate for %s took %s", c.GetKey(), time.Since(t)) + }() + if err := c.HandleRender(); err != nil { return err }