Thanks, Shanghai isnt a new city. People tend to forget by 1292 it had a population of 300,000 after becoming the major port of the lower Yangtze - more than 4x larger than Europe's largest city at the time, Constantinople (Istanbul). However when a centuries long ban on ocean going vessels was put into effect, and the coast fell victim to decades of marauding Japanese pirates, the population declined to 200,000 by the 1680s (but still would have been Europes 4th largest city).
https://en.wikipedia.org/wiki/Shanghai
When the ban was lifted and the city saw a resurgence, once again becoming the main port of the region, it was 550,000 by the arrival of the British in 1842, despite being technically a 'village' having never upgraded it's status in the Chinese courts - and hence why many colonists referred to the place as a sleepy fishing village before their arrival. Although technically they were right, and it was not one of China's main cities either, the 'village' would have still maintained it's position as 4th largest city in Europe at the time, behind London, Paris and Constantinople and ahead of St Petersburg, Berlin, Moscow or Rome.