Attempt to speed up precedence_depth calls.