In the new film Funny People, Ira Wright, the character played by Seth Rogen, reveals more or less inadvertently that the reason he became a stand-up comedian was because he was ridiculed by his classmates as a boy. This is probably one of the film's most profound moments, although it hardly treats it as such; but there's a long and illustrious history of comedy serving the purpose of concealing people's feelings, both on and off screen. And filtered through the meta-movie stardom of Adam Sandler's ailing A-lister, Funny People is precisely about the walls people put up in one way or another to protect themselves from emotional harm – which, as the film observes, almost always become a prison for the person who builds them.

Sandler plays George Simmons, a mega-comedian and movie star who decides to "return to his roots" in stand-up after a doctor diagnoses him with a rare and inoperable disease that gives him only a limited time to live. After a disastrous appearance at a local club, George meets Rogen's Ira, an aspiring comedian who mines a few laughs out of his performance, and he hires Ira to write jokes for him, and eventually, to work as his personal assistant. But when George reconnects with his ex-girlfriend Laura (Leslie Mann), who is now married to a daffy Australian huckster named Clarke (Eric Bana), he begins to truly reconsider his affluent but empty lifestyle.

It's tough to know how close to the bone Apatow cut in his fictional portrayal of a modern comedy star who revels in success but loathes his work, but casting Sandler was a stroke of genius, especially since the funnyman has always had a cagey relationship with critics and the media. That's not to say that Sandler is Simmons, merely that the film creates an effective self-parody for the actor, whether it's accurate or pure audience association. At the same time, Sandler seems to have found a perfect role that exploits both his comedic chops and his burgeoning dramatic skills, the which have certainly been displayed memorably (see the uneven but underrated Spanglish, or especially Punch-Drunk Love) but not yet in equally effective measures; here, he gets to be the doofus, the snarky king of punchlines and the sincere straight man, wandering through his own life with too much of others' expectations reflected back upon him and not enough of himself.

Meanwhile, Funny People has been broadly championed as Apatow's most personal film to date, but I wonder if that is less because of the director's own comments than the perception that a comedian "going serious," even by a matter of degrees, must necessarily constitute a passion project. That said, it's certainly his most human and deeply felt film, but at most this feels like a tribute to his own wife and family, all of whose members make an appearance; otherwise, it continues the writer-director's trend of depicting relationships in realistic and often unflattering dimensions, while finding the humor and heart in all that messy reality.

Unfortunately, the film's lackadaisical structure undermines some of its dramatic momentum, and it feels overlong without having too many specific scenes or moments that should be excised; while I watched Funny People I was reminded occasionally of the 40-Year-Old Virgin Extended Edition cut, where I enjoyed all of the new material and extended scenes by themselves but recognized that the theatrical version was simply better dramatically. Unlike many of its detractors, I wasn't bothered by the end, either in terms of its developments or its duration, but think that some of the earlier sequences could have been tightened without losing the character development or just the humor, which is probably why when the film gets down to business in the final act it feels like it's been such a long time coming.

In fact, the end of the film is precisely what makes Funny People a triumph; watching its final scene, I was reminded of movies I consider classic of this same comedic-dramatic genre, like About Schmidt, where the ending seems like it will never come, but when it does, it works so beautifully it doesn't need to be one second longer. Apatow understands that the character's realization is enough, and that we don't need another decade, much less two more hours, to watch him 12-step his way back into the audience's hearts.

Meanwhile, there are countless other charms to mention, including the film's painfully accurate depiction of Hollywood ambition among the almost-theres, its portrayal of the feeling of being on stage as a stand-up, and among an ensemble of great performances, Eric Bana's standout turn as Laura's earnest-doofus husband, who scarcely can keep his foot out of his mouth even as he offers sincere if painfully uninformed philosophical platitudes. But as a whole, Funny People is one of the summer's, if not the year's best films, because it's a comedy that inverts the medium's typical use – effectively revealing feelings rather than concealing them – and invites the audience to share in that discovery.