TRAVEL by ferry from Hong Kong to Shenzhen, in one of the regions that makes China the workshop of the world, and an enormous billboard greets you: “Time is Money, Efficiency is Life”.

China is the world's largest manufacturing power. Its output of televisions, smartphones, steel pipes and other things you can drop on your foot surpassed America's in 2010. China now accounts for a fifth of global manufacturing. Its factories have made so much, so cheaply that they have curbed inflation in many of its trading partners. But the era of cheap China may be drawing to a close.

Costs are soaring, starting in the coastal provinces where factories have historically clustered (see map). Increases in land prices, environmental and safety regulations and taxes all play a part. The biggest factor, though, is labour. On March 5th Standard Chartered, an investment bank, released a survey of over 200 Hong Kong-based manufacturers operating in the Pearl River Delta. It found that wages have already risen by 10% this year. Foxconn, a Taiwanese contract manufacturer that makes Apple's iPads (and much more besides) in Shenzhen, put up salaries by 16-25% last month. “It's not cheap like it used to be,” laments Dale Weathington of Kolcraft, an American firm that uses contract manufacturers to make prams in southern China. Labour costs have surged by 20% a year for the past four years, he grumbles. China's coastal provinces are losing their power to suck workers out of the hinterland. These migrant workers often go home during the Chinese New Year break. In previous years 95% of Mr Weathington's staff returned. This year only 85% did. Kolcraft's experience is typical. When the American Chamber of Commerce in Shanghai asked its members recently about their biggest challenges, 91% mentioned “rising costs”. Corruption and piracy were far behind. Labour costs (including benefits) for blue-collar workers in Guangdong rose by 12% a year, in dollar terms, from 2002 to 2009; in Shanghai, 14% a year. Roland Berger, a consultancy, reckons the comparable figure was only 8% in the Philippines and 1% in Mexico.

Joerg Wuttke, a veteran industrialist with the EU Chamber of Commerce in China, predicts that the cost to manufacture in China could soar twofold or even threefold by 2020. AlixPartners, a consultancy, offers this intriguing extrapolation: if China's currency and shipping costs were to rise by 5% annually and wages were to go up by 30% a year, by 2015 it would be just as cheap to make things in North America as to make them in China and ship them there (see chart). In reality, the convergence will probably be slower. But the trend is clear. If cheap China is fading, what will replace it? Will factories shift to poorer countries with cheaper labour? That is the conventional wisdom, but it is wrong. Advantage China Brian Noll of PPC, which makes connectors for televisions, says his firm seriously considered moving its operations to Vietnam. Labour was cheaper there, but Vietnam lacked reliable suppliers of services such as nickel plating, heat treatment and special stamping. In the end, PPC decided not to leave China. Instead, it is automating more processes in its factory near Shanghai, replacing some (but not all) workers with machines.

Labour costs are often 30% lower in countries other than China, says John Rice, GE's vice chairman, but this is typically more than offset by other problems, especially the lack of a reliable supply chain. GE did open a new plant in Vietnam to make wind turbines, but Mr Rice insists that talent was the lure, not cheap labour. Thanks to a big government shipyard nearby, his plant was able to hire world-class welders. Except in commodity businesses, “competence will always trump cost,” he says.

Sunil Gidumal, a Hong Kong-based entrepreneur, makes tin boxes that Harrods, Marks & Spencer and other retailers use to hold biscuits. Wages, which make up a third of his costs, have doubled in the past four years at his factories in Guangdong. Workers in Sri Lanka are 35-40% cheaper, he says, but he finds them less efficient. So he is keeping a smaller factory in China to serve America and China's domestic market. Only the tins bound for Europe are made in Sri Lanka, since shipping costs are lower than from China.

Louis Kuijs of the Fung Global Institute, a think-tank, observes that some low-tech, labour-intensive industries, such as T-shirts and cheap trainers, have already left China. And some firms are employing a “China + 1” strategy, opening just one factory in another country to test the waters and provide a back-up.

But coastal China has enduring strengths, despite soaring costs. First, it is close to the booming Chinese domestic market. This is a huge advantage. No other country has so many newly pecunious consumers clamouring for stuff.

Second, Chinese wages may be rising fast, but so is Chinese productivity. The precise numbers are disputed, but the trend is not. Chinese workers are paid more because they are producing more.

Third, China is huge. Its labour pool is large and flexible enough to accommodate seasonal industries that make Christmas lights or toys, says Ivo Naumann of AlixPartners. In response to sudden demand, a Chinese factory making iPhones was able to rouse 8,000 workers from their dormitory and put them on the assembly line at midnight, according to the New York Times. Not the next day. Midnight. Nowhere else are such feats feasible.

Fourth, China's supply chain is sophisticated and supple. Professor Zheng Yusheng of the Cheung Kong Graduate School of Business argues that the right way to measure manufacturing competitiveness is not by comparing labour costs alone, but by comparing entire supply chains. Even if labour costs are a quarter of those in China to make a given product, the unreliability or unavailability of many components may make it uneconomic to make things elsewhere.

Dwight Nordstrom of Pacific Resources International, a manufacturing consultancy, reckons China's supply chain for electronics manufacturers is so good that “there is no stopping the juggernaut” for at least ten to 20 years. This same advantage applies to low-tech industries, too. Paul Stocker of Topline, a shoe exporter with dozens of contract plants in coastal China, says there is no easy alternative to China.

It is fashionable to predict that China's inland factories will supplant its coastal ones. Official figures for foreign direct investment support this view: some inland provinces, such as Chongqing, now attract almost as much foreign money as Shanghai. The reason why fewer migrant workers from the hinterland are returning to coastal factories this year is that there are plenty of jobs closer to home.

But manufacturers are not simply shifting inland in search of cheap labour. For one thing, it is not much cheaper. Huawei, a large Chinese telecoms firm, reports that salaries for engineers with a master's degree are not even 10% lower in its inland locations than in Shenzhen. Kolcraft considered shifting to Hubei, but found that total costs would end up being only 5-10% lower than on the coast.

Topline looked into moving inland, but found huge extra costs there. Infrastructure for exports is still shoddy or slow (shipping by river adds a week), logistics are not fully developed and Topline's entire supply chain remains on the coast. It decided to stay put.

Inland revenue?

Moving inland brings all sorts of unexpected costs. Newish labour laws in wealthy places such as Shenzhen make it costlier to shut down plants there, for example. It can cost more to ship goods from the Chinese interior to the coast than from Shanghai to New York. Managers and other highly skilled staff often demand steep pay rises to move from sophisticated coastal cities to the boondocks. Chongqing has more than 30m people, but it's not Shanghai. A recent anti-corruption campaign there grew so violent that it terrified legitimate businessfolk as well as crooks.

The firms investing in China's interior are chiefly doing so to serve consumers who live there. With so many inland cities booming, this is an enticing market. But when it comes to making iPads and smartphones for export, the world's workshop will remain in China's coastal provinces. In time, of course, other places will build better roads and ports and supply chains. Eventually, they will challenge coastal China's grip on basic manufacturing. So if China is to flourish, its manufacturers must move up the value chain. Rather than bolting together sophisticated products designed elsewhere, they need to do more design work themselves. Taking a leaf out of Germany's book, they need to make products with higher margins and offer services to complement them. A few Chinese firms have started to do this already. A visit to Huawei's huge corporate campus in Shenzhen is instructive. The firm was founded by a former military officer and has been helped by friends in government over the years, but it now more closely resembles a Western high-tech firm than it does a state-backed behemoth. Its managers are top-flight. Its leaders have for several years been learning from dozens of resident advisers from IBM and other American consultancies. It has become highly professional, and impressively innovative. In 2008 it filed for more international patents than any other firm. Earlier this year, it unveiled the world's thinnest and fastest smartphones. In a sign that at least China's private sector is beginning to take intellectual-property rights seriously, Huawei is locked in bitter battles over patents, not only with multinationals but also with ZTE, a cross-town rival that also wants to shift from being a low-cost telecoms-equipment maker to a creator of sexy new consumer products.

China does not yet have enough Huaweis. But it attracts plenty of bright young people who would like to build one. Every year another wave of “sea turtles”—Chinese who have studied or worked abroad—returns home. Many have mixed with the world's best engineers at MIT and Stanford. Many have seen first-hand how Silicon Valley works. Indeed, Silicon Valley veterans have founded many of China's most innovative firms, such as Baidu.

The pace of change in China has been so startling that it is hard to keep up. The old stereotypes about low-wage sweatshops are as out-of-date as Mao suits. The next phase will be interesting: China must innovate or slow down.