The contenders for San Francisco mayor are perfecting the pronunciation of their names in Cantonese. They are scrambling to recruit the best Chinese-speaking volunteers, in what one campaign manager described as a bona fide “arms race.”

And they are grabbing any opportunity to meet with Chinese American voters in the city. Ding Lee, a former president of the Chinese Consolidated Benevolent Association, said that in the past, mayoral candidates would pop by the association’s historic building in Chinatown for a photo-op and leave after 10 or 15 minutes.

“Now they almost never turn down an invitation to come, and they stay for the whole event,” Mr. Lee said with a chuckle. “They know that the Chinese vote is quite powerful now.”

Nationally, Asian American voters often have to fight for attention because their numbers are still considered too few in most states for campaigns to invest heavily in outreach. But in San Francisco, where people of Chinese descent comprise more than one-fifth of the population, mayoral candidates believe that Chinese voters could decide the outcome in November.

The community has become more politically energized than it has been in years, helping to drive what many say has been a moderate backswing in the famously liberal city. Chinese Americans were seen as a driver of two recall elections that shook the city in 2022, to replace progressive school board members and a liberal district attorney.