Federer displayed a new brand of aggressive tennis and went on to dominate the tour claiming seven titles which included two Grand Slams. He is looking to win at Indian Wells for a record sixth time, after setting a record past year as the oldest player ever to win the event.
Krajinovic had no answer for Federer's serve or relentless return game and ended up winning just 31 of the match's 93 points.
"To me, it's not that surprising", Federer said after his second round win over Federico Delbonis.
He said playing matches three days in a row doesn't faze him. It's what tennis players do.
"I was grateful to be out on the court after surgery that quickly but at the same time just didn't feel good at all".
Barcelona midfielder Sergio Busquets: 'We will try to help Andre Gomes'
It leads me to feel ashamed and sometimes I feel that I can not leave the house due to the shame and due to people looking at me. I can not shake negative moments out of my head and it impacts on my performances and I am thinking too much.
His title defence got off to a soggy start on Saturday night when play was suspended because of rain showers with Federer up a set and tied 2-2 in the second. "I think I'm okay". The other victory came in Rotterdam.
Federer and 10th seed Djokovic both came into the tournament seeking to become the first six-time victor of the event.
In the next round he faces Jeremy Chardy, who beat fellow Frenchman Adrian Mannarino 7-5, 4-6, 6-1.
Stephens, the 13th seed, lost to No. 20 Daria Kasatkina of Russian Federation 6-4, 6-3, and fell to 2-4 in matches this year.
Also, American Taylor Fritz defeated Fernando Verdasco of Spain, 4-6, 6-2, 7-6 (7/1), Croatia's Borna Coric breezed past Roberto Bautista 6-1, 6-3 and Pablo Carreno-Busta of Spain, stopped Russian Daniil Medvedev 6-1, 7-5.
Seventh seed Kevin Anderson took down Nicolas Kicker 7-6 (1) 7-6 (3) and South Korea's Chung Hyeon beat Tomas Berdych 6-4 6-4.