Menu

#108 Accelerated handling of large cvs outputs

WinCvs
closed-fixed
WinCvs (90)
5
2005-06-09
2005-05-28
No

!!! This patch also contains a critical bug fix and some code
cleanup, see below. !!!

The "Select tag/branch" dialog worked very slow on my
system when applied to local repositories. I've found that
one of the reason is that WinCvs does not suitably handle
very large textual outputs. (Another reason is a bug in cvsnt
that is provided with the WinCvs setup: The "-l" switch is
ignored for the "cvs log" command.)

With this patch, WinCvs is now able to handle very large
textual outputs much better than before. There is still room
for optimizations, however.

A complete list of changes follows.

ServeProtocol: Drastically minimized the number of
(expensive) calls to PeekNamedPipe by counting the
number of processed bytes and skipping the call if there still
is data in the pipe. (Several methods needed a new
parameter "gulong& rcount" to achieve this.)

CCvsRootConsole: Members m_cvsOut and m_cvsErr
(std::stringstream) have been replaced by m_cvsOutVec
and m_cvsErrVec (both std::vector<char>) and higher-level
access routines. Reason: stringstream (and strstream) work
horribly slow when appending data to large streams - on
overflow the data buffer is increased only by a constant
size, resulting in O(n^2) run time. With std::vector, the
internal buffer size is doubled on overflow, resulting in O(n)
amortized run time.

CCvsRootConsole: Replaced stringstream with istrstream.
Reason: The stream's initialization with a string only works
reasonably well with istrstream.

CAllHandlers: m_wireHandlers is now a "plain old" array of
size three. Using std::map for this trivial task hurt
performance badly.

cvs_process_give_time: Sleep(1) inserted for WIN32 to
avoid 100% CPU utilization.

struct _WireMessage: The formerly dynamically allocated
member "data" is now a static member of the struct. This
saves one malloc/free per message.

cvs_process_stack: Is now std::vector instead of
std::deque. This saves one malloc/free per message.

-------------------------------------------

The following two are not related to performance but
included in this patch.

Bugfix (ItemListDlg.cpp, CTagParserConsole::Parse):
Stopping the retrieval of all tags sometimes crashed WinCvs

Code cleanup (ItemListDlg.*): Class CItemListConsole now
inherits from CCvsRootConsole, thus saving redundant
code (cvs_out, cvs_err, ...)

Discussion

  • Kirill Müller

    Kirill Müller - 2005-05-28
     
  • Jerzy Kaczorowski

    Logged In: YES
    user_id=119527

    Thu Jun 09 2005 Jerzy Kaczorowski <kaczoroj@hotmail.com>
    * WinCvs 2.0.3:
    - #1210404 - Accelerated handling of large cvs outputs,
    patch by Kirill Mller <kirillmueller@users.sourceforge.net>

     
  • Jerzy Kaczorowski

    • status: open --> closed-fixed
     

Log in to post a comment.