Federer, who needed just 54 minutes for his victory, was joined as an easy winner by third seed Novak Djokovic, the form player of 2011 with two titles from as many events, who hammered Latvian Ernests Gulbis 6-0, 6-1.
The 16-time Grand Slam champion Federer will take on one of the rawest members of the young generation when he plays 18-year-old Ryan Harrison, ranked 152nd. The youngster tamed Canadian breakthrough artist Milos Raonic 7-6 (7-1), 4-6, 6-4, with the loser still producing 17 aces.
"Especially on a hot day like this, you pick the right days to play well and win quickly," Federer joked.
"I'm happy it went so well today. The opening couple of games were kind of tough. I was able to move him around. Then I was able to mix it up, and I took his options away a bit. At the end, it was a great match - for me, anyway."
Third seed Djokovic, the 2008 champion, won the first nine games against Gulbis, a patchy talent ranked 34th.
"I was just trying to keep the ball in the court, not doing too much, making him play an extra shot and changing the pace. He was not feeling comfortable, obviously," Djokovic said.
Djokovic has been unstoppable so far this year, now standing 14-0 on the season with Australian Open and Dubai titles in the bag. Wimbledon finalist Tomas Berdych, the seventh seed, made a quiet move into the fourth round as he defeated Brazilian Thomaz Bellucci 6-3, 6-2.
Frenchman Richard Gasquet knocked out Austrian 10th seed Jurgen Melzer 6-1, 6-3; Serb Viktor Troicki, the next Djokovic opponent, beat Michael Llodra 6-3, 6-3. Federer's compatriot Stanislas Wawrinka defeated Marin Cilic 7-5, 6-3.
In women's play, top seed Caroline Wozniacki rescued a 2-6, 6-3, 6-1 win over Russian Alisa Kleybanova to stay alive on a day when second seed Kim Clijsters had to quit with a lingering shoulder injury from January.
"My intentions are to go to Miami and rehab there and plan on playing my first round," said Clijsters.
"I'm going to just see every day how it goes. Obviously I'm going to need a few days of rest. You know, I'm going to probably go and have some tests done there and see." Clijsters said she has been troubled by the shoulder since January: "I already felt it in the last few tournaments. At the end of the Australian Open I was already having some acupuncture from my trainer because I was having some pains in that shoulder. With the drive volleys that I was hitting, everything that was kind of a little bit higher up, I felt I was struggling with it a little bit."
Bartoli will next face unseeded former number one Ana Ivanovic, who hammered Jelena Jankovic 6-4, 6-2. Israeli 10th seed Shahar Peer beat French Open champion Francesca Schiavone 6-4, 3-6, 7-6 (7-3), while eighth seed Victoria Azarenka stopped Agnieszka Radwanska, the Polish number nine, 4-6, 6-3, 7-6 (7-3).