China-watchers say Mr Xi’s ebullience since he took power has been spurred by the view that Mr Obama has only a limited window in office. After that, Hillary Clinton, or a Republican, will take over. Either would be tougher on the world stage than Mr Obama. Even if that is wrong, Mr Xi has shown Mr Obama little respect since their first summit in California last year. Mr Obama warned his Chinese counterpart to stop the cyber attacks on the Pentagon and other targets. China’s cyber-incursions increased. Earlier this year, the White House indicted five Chinese nationals for cyber-espionage, including a senior military officer. None are likely to be brought to trial. It was the kind of empty gesture Beijing has come to expect of Mr Obama.

It is a fair guess that China would be more assertive whoever was in the White House. Its aim is to become a global power. It sees bodies such as the International Monetary Fund as ciphers of US interests. Whoever was US president, China would be trying to undercut US-led institutions.

Likewise, it is hard to believe Mr Obama has caused Chinese military spending to be higher than it would other wise have been. It is soaring nonetheless.

Since Mr Obama took office, China has invested heavily in expanding its “area of denial” to deter the US from coming to the defence of other claimants in the South China Sea. China is close to joining the US and Russia to become a triad nuclear power with the ability to launch warheads from submarines as well as from air and land. It is investing billions in “hypersonic” ballistic missiles and other future tools of warfare. Once a symbol of impregnability, America’s fleet of aircraft carriers look increasingly archaic.