Opened 12 years ago

Closed 12 years ago

#397 closed enhancement (fixed)

Node::print_copyright(2) is extremely slow

Reported by: Peter Johansson Owned by: Peter Johansson
Priority: minor Milestone: svndigest 0.7
Component: svncopyright Version: trunk
Keywords: Cc:


I quick analysis showed that there are two major guys here. The first thing is

SVNlog log(SVNinfo(path()).repos_root_url());

which seems to be expensive when bandwidth is the bottleneck. I see no obvious way to avoid this call here, but perhaps we should add some printout (in verbose mode) so user understands what is going on.

The second thing and much worse it seems, is the line

year2rev[timeinfo->tm_year] = std::min(i->revision(), last_changed_rev());

where I guess the expensive thing is last_changed_rev(). Remember, that this is called from the grand mother Node (tree in main) and last_changed_rev calls log() which in turn calls Node::log(). The latter call is the bandit here because it calls Node::log for all daughter nodes and so on, which results in N calls to Node::log() where N is number of files in the tree. Can we avoid this somehow?

Why is the std::min needed in the first place?

Why is last_changed_rev calling log instead of retrieving the info from an SVNinfo object, i.e., is there a difference between svn log and svn info | grep Last Changed Rev? Could we use svn info, and for directories we could still parse through daughter nodes and pick the highest revision.

Alternatively, if I remember correctly it is possible to call svn log without walking through the entire log but only pick the first (or the latest) N commits.

Change History (2)

comment:1 Changed 12 years ago by Peter Johansson

Status: newassigned

comment:2 Changed 12 years ago by Peter Johansson

Resolution: fixed
Status: assignedclosed

(In [834]) fixes #397. get latest rev from SVNinfo instead of SVNlog

Note: See TracTickets for help on using tickets.