Progress bar when opening repositories

Issue #2 resolved
Peter Hosey
created an issue

When Murky opens a large repository, it pinwheels. Better to show the window as blank with a radar control or progress bar, then swap in the real repository view when it's done loading.

(Ideally, Murky would also switch to asynchronous I/O for reading the repository data, in order to allow the user to operate on or open another repository while Murky reads from the first repository.)

Test cases: The Growl repositories, such as {{{bb+ssh://boredzo/growl}}} and

Comments (3)

  1. Jens Alfke repo owner
    • changed status to open

    Ah, good point. I guess those repos must be a lot larger than mine!

    Murky actually doesn't read repos directly; it uses NSTask to run the "hg" tool. My HgTask class can run asynchronously, but in some places I've been lazy and used synchronous mode.

  2. Jens Alfke repo owner

    I tried opening the Growl repo -- it looks like almost all the time is spent inside NSXML, parsing the output from 'hg log'. This happens while the nib is loading, when setting up the view bindings hits the 'revisions' property:

    1883 Thread_2907
      1883 start
        1883 main
          1883 NSApplicationMain
    1883 -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:]
      1883 -[NSObject(NSKeyValueCoding) valueForKeyPath:]
        1883 -[NSObject(NSKeyValueCoding) valueForKeyPath:]
          1883 -[NSObject(NSKeyValueCoding) valueForKey:]
            1883 -[HgRepository revisions]
              1883 -[HgRepository _checkRevisions]
                1883 -[HgTask run]
        1883 -[HgTask _finishUp]
          1883 -[HgLogOperation finished]
            1883 -[HgLogOperation _parseFullXML]
              1883 -[NSXMLDocument initWithData:options:error:]
                1882 -[NSXMLTreeReader parse]

    1. Should defer loading the revisions till after the window finishes opening. 2. Should see if I can speed up parsing by using an hg template with more minimal XML.

  3. Jens Alfke repo owner

    I just committed a new revision 0cbde1f9308c that optimizes the initial loading. It now only loads a minimal amount of info about each revision when the repo window opens: just the ID, local rev #, and parent(s). The rest of the revision info is loaded lazily when needed, in batches of 20 consecutive revisions.

    That cuts the time to open the Growl repo down to about 3 seconds on my machine. Hopefully that's good enough that we won't need a progress bar.

    I'll mark the issue as Resolved; try it out and if you still think it needs more improvement, re-open it. Thanks.

  4. Log in to comment