ListLastCommitForTree: avoid climbing the entire changelog for each path
The new algorithm in `latest_changeset_for_path` was more efficient on average than using the `files` revset predicate on a single path, but it was inefficient to do it over and over for a serious amount of paths in `ListLastCommitsForTree`. We now climb the changelog only once, keeping track of wanted files and subdirectories along the way. Measurements taken on the `tests/` directory of the mercurial-devel repository (in seconds): revset based: 270s parent changeset: 426s this changeset: 19s Figures taken before a small fix on the new implementation that could have improved performance. This is still quite bad, but less catastrophic than it was, and it is amenable to a Rust reimplementation.
Loading
Please register or sign in to comment