South Africa captain AB de Villiers hailed an "almost perfect performance" after his team crushed Sri Lanka by 121 runs in the second one-day international at Kingsmead on Wednesday.

He singled out Faf du Plessis and David Miller, who both hit centuries as South Africa recovered from a poor start and piled up 6-307 after being sent in on an unusually dry, slow Kingsmead pitch.

Du Plessis (105) and Miller (117 not out) put on 117 for the fifth wicket off 136 balls after South Africa had been struggling at 4-108.

South Africa's total always seemed likely to be too many for the visitors to chase and so it proved, as Sri Lanka were bowled out for 186, giving South Africa a 2-0 lead in the five-match series.

"It was a fantastic effort by Faf and David, an incredible partnership after being four down early on," said de Villiers.

The batting was backed up by good bowling and lively fielding.

Sri Lanka made a quick start, with Niroshan Dickwella and Upul Tharanga putting on 45 for the first wicket off 46 balls.

But both openers fell to outstanding catches, by du Plessis and de Villiers.

"They played well in the first ten overs and took it to us. But we have a lot of class in the bowlers and we picked up wickets at important times," said de Villiers.

Sri Lanka captain Tharanga rued the failure of any of his batsmen to make more than Dinesh Chandimal's top score of 36.

"There were lots of twenties and thirties but nobody went on," he said.

Tharanga said the stand between du Plessis and Miller was the biggest difference between the teams.

"We took four wickets but Faf and Miller had a very good partnership. If one of our batsmen had gone on and made a big hundred maybe we could have chased it down."

De Villiers said South Africa had worked hard on taking their chances in the field after missed opportunities let them down when they lost a recent Twenty20 series.

"You don't get that many chances in white ball cricket. When you do you have to take them."

Largely due to du Plessis, South Africa maintained a reasonable scoring rate despite losing their first four wickets cheaply, with none of the four batsmen dismissed able to reach 20.

The left-handed Miller initially reined in his normal attacking instincts as he and du Plessis made steady progress against an assortment of accurate slow and slow-medium bowlers.

The partnership ended when du Plessis was caught at long-on after facing 120 balls and hitting seven fours and a six.

Miller and Chris Morris plundered 60 off 43 balls for the sixth wicket and Miller finished the innings strongly, reaching his century in the final over and celebrating with two sixes and a four off Nuwan Kulasekera.

He hit six sixes and three fours in his 98-ball innings.

The opinions expressed here are the views of the writer and do not necessarily reflect the views and opinions of Cricket Australia.