The function calls diff.find_similar() for every commit in the walk, even when not needed. The find_similar() method performs rename detection which can be computationally expensive, especially for large commits.
Consider optimizing by only calling find_similar() when there's a potential match, or at least document the performance implications of calling this for every single-parent commit in the repository history.
Originally posted by @Copilot in #293 (comment)