In the match of his life on Wednesday in Melbourne, Australia, Noah Rubin lost. But there was so much he gained.

He was up against arguably the greatest player of all time in the second round of the Australian Open, the season’s first Grand Slam. He was playing on Center Court in front of 15,000 people. He was being seen on televisions around the world.

And the 20-year-old from Merrick showed Roger Federer, the fans in the stands and those in their couches internationally that he has game.

Rubin lost in straight sets but put on a straightforward performance. The score was 7-5, 6-3, 7-6 (3) for Federer, the 17-time Grand Slam champion. Rubin was disappointed he didn’t force a fourth set when up a break in the third, but the experience still was what he had trained for all his life, and the thrill of playing Federer can never be taken away.

“There’s something about him,” said Rubin. “You just look and say, ‘Wow, OK, that’s Roger Federer.’ A couple of times in the first set I just took a peek over to the other side.”

Federer, 35, is coming back after six months of rehabilitation from knee surgery, the longest break of his career. His last Grand Slam title was in 2012 at Wimbledon. Novak Djokovic, Andy Murray, Rafael Nadal had overtaken him in the rankings, but he remains the game’s undisputed icon.

advertisement | advertise on newsday

“I told him at the end of the match it was an honor to be out there with him because no matter what the outcome is, if he’s not the greatest he’s top two,” Rubin said. “He thanked me and said, ‘Great match.’ ”

Rubin stayed in the rallies well, yet couldn’t quite figure out Federer’s serve, a weapon more for its disguise and placement than its pace, though it has plenty of that. Rubin didn’t force a break point until the seventh game of the second set and finally was able to break Federer in the second game of the third set. Rubin held set points in the eighth game but couldn’t convert. Serving for the set in the ninth game, Federer broke him and took the set to the deciding tiebreak.

“I was very impressed by Noah,” said Federer, who knew virtually nothing about him going into the match though they do share a distinction — both are former Wimbledon junior champions. “I thought he played really well. I feel like he’s going to have a great, consistent career. The question now is how far can he go. It’s so hard to tell with these youngsters because they just need time to mature and to get used to the tour and all that. I think there’s lots possible for him, I really do.”

His father, Eric, back on Long Island, who introduced Rubin to tennis as a toddler and remains a co-coach, was thrilled.

“It was an extraordinary performance for the first time in front of 15,000 fans on a Slam center court,” Eric said. “He can get 35-50 percent better on his forehand, backhand and first serve. So much room for improvement. He will absolutely be one of the greatest.”

@NewsdaySports

Rubin would have loved to push the match to that fourth set.

“I’m actually pretty disappointed,” Rubin said. “My coaches say that’s a good thing. I came out of the match thinking what it would be like to be in a fourth set. My body felt pretty good out there. I liked my chances competing-wise against him, and I thought it would be a lot of fun to be out there against him for another set.”

Despite the loss, Rubin gained a boatload of confidence. He’s a small player in the modern era, only 5-9. But he’s lightning quick, has a decent first serve, an impressively popping second serve and good court sense.

“I think I have a lot to offer to this game and I really enjoy being out there,” Rubin said. “Hopefully my speed can make up for my height because I have none of that, as you can see.”

His mother, Melanie, was more than proud.

advertisement | advertise on newsday

“Noah was composed, determined and did not allow the enormity of the situation to faze him,” she said. “He held his own against an idol of his and arguably the greatest player of all time. When I spoke with Noah after the match, he told me to look forward to the rematch.”