The initial joy of watching LeBron James onscreen in “Trainwreck” likely owes to the relief of discovering that he is not as terrible as he had every right to be. Image by Mary Cybulski / Universal Pictures / Everett

Based on the unscientific metric of audience laugh rate during a well-attended Sunday matinee, LeBron James is the funniest person in "Trainwreck," a movie written by and starring one culture-certified comedy genius, Amy Schumer, directed by another, Judd Apatow, and featuring the likes of Bill Hader, Colin Quinn, Dave Attell, Vanessa Bayer, and Mike Birbiglia. This is, depending on how you look at it, either a happy revelation of James's diverse talents or an unfortunate detail about the movie to which he lends them.

But let's stick to the good news: James, playing a gently bizarro version of himself, steals the show. He is the best friend of Schumer's love interest, a sports surgeon named Aaron Conners (Hader), and serves as the wary gatekeeper of his friend's fragile heart. This familiar rom-com role often produces reliable laughs, but it is normally played by a quirky comedic actress in pajamas, rather than by the best basketball player on the planet—and so the initial joy of watching James onscreen likely owes to the relief of discovering that he is not as terrible as he had every right to be. But that low bar is cleared quickly, during his first scene, after he nails a bit about being so cheap that he'd drive forty minutes out of his way to retrieve a pair of thirty-dollar sunglasses.

From there on—as he haggles over an itemized brunch bill, refers to sex as “making love,” sings the praises of Cuyahoga sunsets, and offers dating advice in the form of a spoken-word monologue of Kanye West's “Gold Digger”—it becomes clear that James has delivered something more than just a passably good cameo. He plays himself as at once artless and knowing, cheerfully sentimental but with a mean streak when it comes to protecting his buddy. In a requisite scene of one-on-one with Conners, he forgets to go easy and innocently bullies his feeble opponent all over the court. Was I the only one who, at some point, wanted the camera to leave the movie stars for a while and see what this LeBron character was getting up to on his own?

Maybe I am still in the thrall of watching James grill Schumer about her intentions with his friend—“When you look at the clouds, do you see his face?”—but it seems safe to declare that he has given the greatest motion-picture acting performance by an active professional basketball player of all time. This may sound like especially narrow praise, but that category includes plenty of hall-of-famers. Kareem Abdul-Jabbar's performance in “Airplane!,” as the co-pilot Roger Murdock, looms large (“The hell I don't!”), but, looking at it again, Abdul-Jabbar appears a bit more stilted than I remembered. Ray Allen was credible as a high-school phenom in Spike Lee's “He Got Game,” playing opposite Denzel Washington, but the role's lasting impact owes more to the character's cool name, Jesus Shuttlesworth, than it does to Allen's acting chops. The various onscreen performances of funny-in-real-life Shaquille O'Neal, meanwhile, are mostly beneath mention, though other players who get scripts sent their way would be wise to recall his disastrous turn as a rhyming genie in the movie “Kazaam.” Last week, Charles Barkley aimed a little shade at James, saying, “LeBron should call this ‘Trainwreck 2,’ cause the Finals were ‘Trainwreck 1.’ ” But perhaps he was just worried that James had eclipsed his own dramatic exploits.

LeBron's most serious historical competition comes, as it always does, from Michael Jordan, and his starring turn in the partially animated Warner Brothers corporate bonanza “Space Jam,” from 1996. Amid rampant product placement, Jordan gives a charming and self-effacing performance, full of shrugs and smirks, all while acting in front of a green screen among cartoon characters that weren't in the room. Such conditions have gotten the better of many professional actors, yet Jordan made it through without looking any more ridiculous than he was supposed to. James had the benefit of working with living, breathing, funny humans, and with a script that let him be a silly version of his real self—but even so, it is a pleasant surprise to see James, who is sometimes referred to as a kind of charmless basketball cyborg, display some Jordan-level charisma. Enjoy it while it lasts, though, because James might just have been too good in “Trainwreck” for his, and our, own good. The offers will be coming in. Most of them will be terrible. Hopefully no one will ask him to play a genie. But what about “Space Jam 2”?

James, meanwhile, is not the only athlete to show up in “Trainwreck,” and the presence of Amar'e Stoudemire, Chris Evert, and Tony Romo only serves as more evidence of his better-than-expected performance. Reviewing the movie in the magazine, Anthony Lane points out that, after a while, “the namechecks become an embarrassment.” These cameos indeed seem mostly to be about the filmmakers’ industry juice, and a clear signal of the movie's aim for mass appeal. But the presence of these real sports people isn't entirely out of place, since sports themselves occupy a surprisingly important, and even heroic, role in the movie, which is odd, since Schumer, who wrote it, and Apatow, who directed it, both claim to hate sports.

But consider the plot: it begins with Schumer's character, Amy Townsend, in an editorial meeting at the men's magazine where she works, delivering a speech in which she says that sports are infantile and uninteresting, a blight on the American landscape—and that the people who like them, especially the men who like them, are boring and terrible. This is a fair social critique—sports as a domineering force, an expensive entertainment masquerading as culture. Then she meets Aaron Conners, the sports doctor whom she is assigned to profile. She admits to knowing nothing about the players he repairs—after claiming, for a moment, to root for the Long Island Mediums and the Orlando Blooms. Conners, of course, loves sports, arguing that they are an important source of community, that they bring people together. This disagreement is the proxy for the chasm between the characters that must be crossed. Something's gotta give.

And it isn't going to be sports. In a battle between love and basketball, even in a movie by sports skeptics, basketball wins. In Schumer's telling, a woman must come around to the joys of the game in order to fit in, and prove her fitness to a man. This isn't “Bull Durham,” in which a love of sports can be a language that both men and women might equally share. Instead, it's more like “Fever Pitch,” in which Drew Barrymore had to become a Red Sox fan to truly understand Jimmy Fallon. “Trainwreck” ends with a triumphant scene at Madison Square Garden, the only time in recent memory when something good has happened at a Knicks game. LeBron James is gone by then, but it was his world that brought everyone together.