Nevertheless, the top seed insisted he was content with how he's playing.
The number one seed and defending champion was pushed all the way by the surprise victor of the Japan Open, but broke in the ninth game of the deciding set before serving out to reach the last 16.
"I feel like I'm where I want to be", Federer said. I think I had 80 per cent first serves in that second set and he broke me twice so he was feeling it. And what looked like a stern test for Federer on paper proved to be exactly that in reality as the Swiss was taken the distance before his opponent ultimately crumbled at the crucial juncture late in the third set.
But in the ninth game of the deciding set, Federer made the breakthrough on his opponent's serve, pumping his fist as another hard-won victory loomed into view.
The Serbian second seed was stunned by the Italian-ranked 72 in the world at the time-in the French Open quarter-finals earlier this year.
"I wanted to start off well because I know that he battles hard and he makes you deserve every point, win every point".
"It was a very tough match, I thought it was a really high level", Federer said afterwards. The account of the meeting- 6:4, 4:6, 6:4. The Serb is on a 15-match winning streak, which includes title runs at Cincinnati and the U.S. Open.
But barely three months after Federer walked out on Centre Court at Wimbledon wearing the whites of his new clothing sponsor, Uniqlo they've got him in the pink - so to speak.
Fourth-seeded Alexander Zverev of Germany also advanced to the quarterfinals by pasting Alex de Minaur of Australia 6-1, 6-4.
Edmund, Britain's number one, defeated Chile's Nicolas Jarry 7-6 (7/5), 6-3.