Howdy folks, I would like to report a performance issue I'm experiencing with TortoiseSVN's Log window.
Steps to repro: - "Show Log" for a large repo (eg, 10'000+ commits) with fast access (eg, local intranet) - press the "Show All" button Outcome: - expected: the Log window get populated in a few seconds - unexpected: the Windows Taskbar freezes for several tens of seconds to multiple minutes In particular, I am seeing this with a repo of ~60'000 commits. I am currently using Windows 11 version 23H2, but I have been experiencing this at least since mid-2023, when I was using Windows 11 22H2 if memory serves. I collected an ETW trace, and it seemed to indicate that the performance bug is somewhere in the progress update code of the Windows Taskbar. Looking at the TortoiseSVN source code, specifically LogDlg.cpp, I got the suspicion that TortoiseSVN calls m_pTaskbarList->SetProgressValue() "too often". This suspicion was also supported by the fact that I cannot reproduce the issue with TortoiseSVN's own repo, which, although similar in size to mine, takes much longer to populate the full log (a few minutes, during and after which the taskbar remains operational). Based on this, I created a workaround that fixes the issue for me. Please find the patch at the end of this message. Cheers, Walter Index: LogDlg.cpp =================================================================== --- LogDlg.cpp (revision 29748) +++ LogDlg.cpp (working copy) @@ -1558,8 +1558,22 @@ { int l, u; m_logProgress.GetRange(l, u); + + int cur = m_logEntries.size() - m_prevLogEntriesSize - l - m_cMergedRevisionsReceived; + int total = u - l; + + // The Windows 11 taskbar has a performance bug, whereby updating the progress value + // quickly enough with different values causes it to freeze while it tries to asynchronously + // process the new values one by one. In our case, showing a log with thousands of entries + // can cause the taskbar to freeze for several seconds or even minutes! + // For this reason, we remap the progress range to [0,100], as calling SetProgressValue() + // with the same value multiple times is ok, and bypasses the slowness. + int cur100 = 100; + if (total > 0) + cur100 = (int)((long long)cur * 100 / total); + m_pTaskbarList->SetProgressState(m_hWnd, TBPF_NORMAL); - m_pTaskbarList->SetProgressValue(m_hWnd, m_logEntries.size() - m_prevLogEntriesSize - l - m_cMergedRevisionsReceived, u - l); + m_pTaskbarList->SetProgressValue(m_hWnd, cur100, 100); } } else if (m_startRev.IsNumber() && m_endRev.IsNumber()) @@ -1572,8 +1586,17 @@ { int l, u; m_logProgress.GetRange(l, u); + + int cur = static_cast<svn_revnum_t>(m_startRev) - rev + static_cast<svn_revnum_t>(m_endRev) - l; + int total = u - l; + + // remap the progress range to [0,100] - see above + int cur100 = 100; + if (total > 0) + cur100 = (int)((long long)cur * 100 / total); + m_pTaskbarList->SetProgressState(m_hWnd, TBPF_NORMAL); - m_pTaskbarList->SetProgressValue(m_hWnd, static_cast<svn_revnum_t>(m_startRev) - rev + static_cast<svn_revnum_t>(m_endRev) - l, u - l); + m_pTaskbarList->SetProgressValue(m_hWnd, cur100, 100); } } } -- You received this message because you are subscribed to the Google Groups "TortoiseSVN" group. To unsubscribe from this group and stop receiving emails from it, send an email to tortoisesvn+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/tortoisesvn/d257bf0d-1481-4fd0-89f4-32a51a03396cn%40googlegroups.com.