Federer, owner of 16 Grand Slam titles, equalled Andre Agassi for the second-most Grand Slam match victories in the Open Era with his 224th -- nine fewer than Jimmy Connors.
The Swiss great wasn't at his sharpest, dropping his serve three times and making 35 unforced errors. Even so, the outcome against the 54th-ranked Giraldo -- who has never beaten a top-10 player -- was never in doubt.
That was all that mattered to Federer, who told the crowd afterwards that winning is "the only thing, really".
"I don't care how I do it," he said. "It doesn't need to be pretty. I don't think I've ever played my very, very best in the first round."
The third-seeded Swiss needed one hour and 16 minutes under the lights on the Arthur Ashe stadium court to advance to a second round clash with Israel's Dudi Sela, who beat Brazilian Thomaz Bellucci 4-6, 2-6, 6-4, 6-3, 6-0.
Federer, who turned 30 earlier this month, is trying to win his first Grand Slam title since the 2010 Australian Open -- and keep alive his streak of eight straight seasons with at least one Grand Slam crown.