Ref T2783. With service-oriented calls, we take a larger performacne hit than necessary resolving refs.
Instead of resolving refs over the wire, try to resolve them from the database first. This can resolve almost all refs (commit hashes, branch and tag names).
This can't resolve weird refs like master~50, and obviously can't resolve invalid refs. In those cases we'll go back to the old logic, call diffusion.resolverefs, and end up with the right result.