Perhaps popping the top of the history of the current branch, then the top of the history of the other branch, then repeat (i.e. current, other, current, other, current, other) and seeing whether there's a match somewhere helps improving the speed. (Or is this speed issue not about finding the common ancestor?)
Perhaps popping the top of the history of the current branch, then the top of the history of the other branch, then repeat (i.e. current, other, current, other, current, other) and seeing whether there's a match somewhere helps improving the speed. (Or is this speed issue not about finding the common ancestor?)