Patrick Steinhardt reported that git log --stat --follow -- include/linux/rsc_table.h on linux.git took roughly 33 seconds with Git 2.55 but almost 8 minutes with 2.56. He bisected it to 304812ed33 (log: improve --follow following renames for non-linear history) and forwarded the report without debugging further.
Miklos Vajna's patch gives the same comparison, 6m43s now against about 28 seconds before. He says the cause is that log_tree_commit() now diffs each merge against all of its parents with rename following, to find the path to follow in each parent. diff_tree_oid() only does the expensive rename detection when the path is added relative to a parent, but that is common for merges, for example when a branch forked before the path existed merges mainline.
The fix makes the per-parent diffing opt-in. Plain --follow behaves as it did before 304812ed33, and the new behaviour is enabled only by an explicit option.
Junio Hamano said he would eject the "speedup" topic and queue Vajna's patch instead for now. He said improving the --follow-merge code can be discussed separately once everyone is happy with the opt-in change.