VcsEventWidget + Slow Mercurial Log

Andreas Pakulat apaku at gmx.de
Fri Jan 15 11:34:41 UTC 2010


On 15.01.10 11:48:43, Fabian Wiesel wrote:
> Hi,
>
> I have a small problem with how VcsEventWidget and Mercurial log interact
> and I am not sure how to proceed.
> It takes quite some time to get all the events and so the VcsEventWidget  
> is stays empty.
>
> One way to solve it, is in the plugin itself, by parsing the log  
> incrementally and
> to emit resultsReady() as I go.  Easy done. But I am not quite sure, how  
> the GUI will then behave.

Thats what Svn support does, though it has a much easier job as the svn
library API already emits the log events asynchronously as it receives them
from the server.

> Also the process still takes quite some time for reading a lot of data  
> people may not be interested in.
> For the project I work on, that is about 30secs for about 5000 changesets.
> How long would it take for a Mozilla-dev with almost 40k changesets? It  
> seems to scale badly.

Well, the idea was that the Log action actually first shows a dialog asking
for the range before it starts fetching the log. But that part is still
missing unfortunately.

> The other way to solve it would be in the VcsEventWidget (or the  
> VcsEventModel):
> Instead of loading the full log, one only loads the necessary parts.
> Maybe the first 100 and the last one  and make a guesstimate about  
> VcsItemEventModel::rowCount().
> When GUI requests other parts of the VcsEventModel, one tries to find  
> the correct blocks.
> Similar problem, how does the GUI behave, if I change the rowCount() on  
> the fly?
> More work, quite a fair amount of more code, but definitely more  
> scalable. But you could say it is a work-around.

This could be possible with canFetchMore/fetchMore in the model API, but
I've only ever seen that used for fetching the children of a node thats
being expanded...

This should work, we don't need to guess the rowCount, the model could just
ask the plugin for 20 revisions starting from HEAD. Then when it receives
the 20th, it asks the plugin 20 revisions starting from this one. Each time
it receives data the existing mechanism is used to add the data, which
adds the rows and lets the view know. With the addition of a "stop" button
in the view one could even allow to cancel this process by the user, so we
don't fetch all 40K revisions, but instead stop at 20K because the user
only wants to look at the 19640th revision or so :)

Andreas

-- 
Your sister swims out to meet troop ships.




More information about the KDevelop-devel mailing list