Complexity of rational addition

I’m using the Scala spire library to benchmark an algorithm which uses Rational arithmetic. I’m exploring the performance differences depending more or less where you put the parentheses.

One of my reviewers has asked about the complexity of the operations.

Does anyone know how to comment about the complexity of spire’s rational addition? I see that Rational.scala imports java.math.BigInteger. I don’t really know whether it is possible to talk about bounds on rational arithmetic as it depends on so many things. Nevertheless, has anyone seen such estimates or bounds anywhere which I can refer to?

You might ask on the Spire gitter channel or open an issue over there.