As golfer Dustin Johnson crushed drives from home plate over the right-field wall and into San Francisco Bay, pitcher Matt Cain and manager Bruce Bochy glanced at each other before looking into the stands for approval from Giants general manager Brian Sabean.

Then, the San Francisco ace grabbed a club and smacked one of his own — splashing the ball into McCovey Cove 310 yards away — hours before he threw the first perfect game in Giants history, striking out 14 in a 10-0 victory over the Houston Astros on Wednesday night.

Cain dazzled with his swing with a 342-yard drive during the Pebble Beach National Pro-Am back in February, yet Sabean hollered that he would turn his head when the pitcher took his drive — and the GM did just that for a moment.

Sabean's apprehension is understandable. In early April, Cain signed a $127.5 million, six-year contract, the largest deal for a right-handed pitcher in baseball history.

"I knew he was a good golfer," Johnson said about Cain. "(Sabean) didn't want him (to hit). He said he was going inside."

Reliever Clay Hensley also hit drives from the tee on home plate, and former first baseman J.T. Snow nearly drilled a spotter with a low drive on his second attempt before adjusting his swing and hitting a couple of pretty drives. A few Astros who came outside to watch the fanfare were offered a chance but declined.

"That was pretty cool," Johnson said ahead of his opening round at the U.S. Open on Thursday. "This is the first time I've been to the stadium, gorgeous stadium. To hit drivers off of home plate is pretty fun, especially out into McCovey Cove. It's probably the coolest place I've hit balls, maybe besides Augusta."

Hensley took his first round of swings — "Let's get him his PGA Tour card!" hollered teammate Aubrey Huff — and later stepped in for a few more, drawing an "Ooooh, wow!" from slugger Pablo Sandoval on a 292-yard shot. Hall of Famer Willie McCovey watched from nearby as balls splashed into his cove. Each drive was tracked for distance and speed on the main scoreboard in center field. Pitching coach Dave Righetti shot a video of the hitting show, saying, "Let's watch the rips," as Hensley took his turn.

"Isn't that amazing?" McCovey said, smiling. "They used to do these kind of things in the minor leagues to draw crowds. It's fun to get the golfers out. This is a big week in San Francisco with the U.S. Open, a lot going on."

Johnson, the St. Jude Classic winner Sunday in Memphis, Tenn., in his second event following a back injury that sidelined him for nearly three months, threw out the ceremonial first pitch and hoped to outdo Rory McIlroy, who did so Tuesday ahead of the Open at The Olympic Club in San Francisco. Johnson bounced his fastball to stand-in catcher and relief pitcher Sergio Romo, drawing cheers from the crowd.

"What a game by Matt Cain!!! I think it was all started by my great first pitch!!!" Johnson tweeted after the game.

If he weren't about to play a major, Johnson said he might consider jumping into the cage for some live batting practice.

Johnson typically takes the Wednesday before a major as an "easy day," so this relaxing outing to the ballpark took some of the edge off. He also has a late tee time Thursday.

"If it was a baseball, I'd be a little bit nervous but hitting a golf ball out here, I can handle that," Johnson said. "I can hit. If I wasn't playing the U.S. Open tomorrow I'd probably do it. I played up until high school, so I haven't swung a bat in a long time. I'll hit in a batting cage every once in a while, but I'm not doing it before I go out and play golf tomorrow."

Bochy opted against hitting a couple of drives.

"I was not going to put myself in a compromising position with my golf game," he quipped.