For the past eight years, the major competitive story line at every meaningful swimming championship has arisen from Michael Phelps’s international and historic dominance. How many medals will he win? How many records will he break? How dramatically will he increase his own legend?

So it’s rather strange to watch Phelps settling into Shanghai for the 2011 world swimming championships this weekend trailed by more curiosity than awe. At the moment, he doesn’t appear to be the best swimmer in his own country, let alone in the world.

That distinction belongs to a free spirit by the name of Ryan Lochte, a two-time Olympian out of the University of Florida, who has muscled past Phelps since the last world championships in 2009, winning more titles, more international acclaim and the distinction of being the most accomplished swimmer on the planet in 2010.

What Michael did in 2008 is definitely going to go down in history,” Lochte said Saturday morning. “It was amazing. But that was three years ago. We’re in 2011, so anything can happen. I know, since 2008, I’m definitely a better swimmer than I was back then. We’re definitely going to put on a show this meet.”

As Phelps’s enthusiasm for training has waned since he won eight gold medals at the 2008 Olympics in Beijing, Lochte has motored by with his head down, setting the stage for a potentially magnificent confrontation or, perhaps, an official changing of the guard, at the Summer Games in London next year. For sure, the two should provide a year of aquatic drama, beginning at the championships here that run through July 31.

Ryan Lochte of the U.S. is seen during training at the 14th FINA World Championships in Shanghai. (DAVID GRAY/REUTERS)

Each is scheduled to swim in four individual events and as many as three relays; they will go head-to-head in the 200-meter freestyle and 200 individual medley.

“I’m kind of playing catch-up now,” Phelps, 26, said before leaving for Shanghai. “I think it’s more motivating. I remember back in 2000, 2001, I was trying to climb and climb and finally I got there. Being back in this position, I think, will be kind of fun.”

Contrast of styles

It will surely be fun for fans who have grown weary of seeing Phelps often race nothing but clocks and history. Lochte, a six-time Olympic medalist whose achievements have long been dwarfed by Phelps’s supremacy, is in many ways the competitive twin of the most decorated swimmer in history. Both boast all-around gifts, the ability to handle heavy meet workloads, excellence in the underwater portions of races and nerves of steel.

But if Lochte’s competitive acumen resembles Phelps’s, his personality could hardly be more different. With his scowls and intensity, Phelps often looks like he could rip a diving platform out of the pool deck before he gets in the water. He is routinely set off by the mere scent of an insult. Though also a furious competitor, Lochte can be a master goofball. He gets serious only after he dives in.

“Ryan is the personality,” said Austrian swimmer Markus Rogan, who attended Mount Vernon High and swam for Curl-Burke Swim Club. “Michael is the machine. It’s such a dramatic difference. Ryan is more like a Dennis Rodman. Michael is more like a Tim Duncan.”

In minor races in which times aren’t crucial, Lochte prefers tiny pink, purple, lime or polka-dotted briefs to the conservative black jammer shorts most of his rivals don. He sports signature metallic-emerald-colored high-top sneakers before race finals, and has worn grills — decorative metal plates for one’s teeth — on medal stands.

At U.S. meets, Phelps always draws full-throated roars from crowds. The cheers for the curly-haired, blue-eyed Lochte — who shows off an extensive modeling portfolio on his Web site, — often take on the higher pitch of squealing teenage girls.

“I don’t really care what people think. As long as I’m having fun, I’ll act a fool,” Lochte, 26, said before this meet. “Me and him live two different lifestyles. Our personalities are different. He’s a more conservative type; I’m more of an out-there, gone-wild type.”

Leveling the field

Despite Lochte’s antics, he seems to have no trouble applying himself to the hard training that Phelps has frequently shunned since Beijing. Phelps’s coach, Bob Bowman, has talked openly about his frustration with Phelps’s unwillingness to commit to a full practice schedule — or any schedule at all — in recent years.

Lochte, meantime, has worked harder than ever since he won two gold medals and two bronzes in Beijing. He said he dramatically changed his eating habits and stepped up his approach to dryland training, adding speed even after the controversial speed suits were banned. Despite a growing itch to escape the university lifestyle, he has remained in Gainesville, Fla., under his college coach, Gregg Troy, since his graduation in 2007. The isolation and routine, he said, have worked.

“There’s been times like, ‘Why am I still in this collegiate atmosphere; I gotta get out of here,’ ” Lochte said. “But I stay there because I have everything perfect. The best swim coach, the best weight-training coach. . . . Everything’s perfect.”

Lochte said he resets his mind at the end of every summer, telling himself he’s no better than anyone else and must start his climb all over again. That, he claimed, is the simple secret to his self-motivation, what’s allowed him to continue training with abandon while Phelps and others have struggled with distractions.

“I went down thinking: ‘I’m at the bottom. I have to work the whole next year getting myself back up to the top,’ ” he said. “I keep doing that to myself. Right now, [that trick] has been working since ’08. Since ’08, I’ve gotten a lot faster each year.”

Phelps has struggled since 2008 and flat-out puttered since 2009, when he had an alternately fabulous and bruising meet at the world championships in Rome, the last major event at which speed suits were allowed.

Unlike Lochte and others, Phelps is only an underdog when he is not totally fit — and even then he still strikes fear into the minds of most competitors. In his and Bowman’s minds, he hasn’t been in top-notch form since August 2008. At the 2009 world championships, Phelps lost his world title and world record in the 200 free to Germany’s Paul Biedermann as Lochte broke Phelps’s world record in the 200 medley.

Last year, as Lochte collected six gold medals at the Pan American Championships in Irvine, Phelps won five but failed to advance to the 400 medley final and pulled out of the 200 medley because of fatigue.

In April, his nine-year, 60-win streak in the 200 butterfly, his signature race, ended with a loss to China’s Wu Peng. Though he had by then grown accustomed to the occasional defeat, that one, he admitted, did not sit well. He then lost two more times in the event in the ensuing months, and he and Bowman had no trouble diagnosing the problem.

“Golf is not really good for the 200 butterfly,” Bowman said Saturday. “We can definitively say that.”

His ego shredded, Phelps vowed to put away his irons and prepare seriously for the coming eight days. During a news conference Saturday, he declared himself in much better shape than last summer.

“It does get frustrating,” Phelps had said earlier. “There are times where it’s not as easy as it once was. I know, deep down inside, there is still the fire that drove me to do what I did before. I know the fire is there to get back to where I want to be.”

When, exactly, that fire emerges is unclear. But this is for sure: If it flickers at these championships, Lochte will be ready.

“I believe in myself,” Lochte said. “That’s that competitive edge that I have. I never feel like I can lose. I always feel like I can win.”